Remove "This gallery contains photos"

  • Author
  • #1041508


    I was hoping to find the above in this forum… Instead, I was only greeted with “If you don’t want that to show up, do not use galleries”

    Not really the answer that I was looking for since I wanted my page to display as a gallery.

    So knowing that the entire source is open and editable, I went searching for the little piece of code that displays that annoying one line….

    If you want to remove it, here are the simple instructions:

    Go to Appearance => Editor
    Look for the file called ‘content-gallery.php’

    Next search for, and either comment out or delete the following code:

    <p><?php printf( _n( 'This gallery contains %2$s photo.', 'This gallery contains %2$s photos.', $total_images, 'twentyeleven' ),
    'href="' . esc_url( get_permalink() ) . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
    number_format_i18n( $total_images )
    ); ?>

    Press ‘Update File’ on the bottom, and your reference to the images should be gone.

    Hope that this helps.



    No, it doesn’t help. First, you’re probably confusing the gallery feature with the gallery post format: the two don’t have to go together. Second, this is the wordpress.COM forum: users don’t have PHP access.

The topic ‘Remove "This gallery contains photos"’ is closed to new replies.