Support » Fixing WordPress » How to edit the original gallery-feature of WP?

  • hey guys,
    when using the standard gallery within my articles, the images will be opened on a new page. that’s nice. but how can i edit this new page? where do i find the code? is it simply the page.php or stuff like that?

    for example: i’d love to remove the title from this image-page and also the sidebar. but how to? hope you understand my english! if not: please ask. i really need your help! thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi


    Forum Moderator

    When a visitor clicks on an image whose link has been set to Post URL, WordPress looks for certain templates in the following order:

    1. image.php
    2. attachment.php
    3. single.php
    4. index.php

    So, if you do not currently have an image.php or attachment.php file in your theme, you’ll need to create one first. I’d suggest you make a copy of single.php to get you started, then strip out the sidebar and image title as needed.

    Thanks! One more problem: when havin made a copy of single.php and renamin it into image.php, it works: every image in a gallery will use this template, but there is no image shown on its single-page. any ideas?

    I would suggest that you base you image.php file on the default theme’s image.php… there are special template tags that are not used in page.php. Some of which are:


    Also, see this plugin if you do not like how WordPress uses images for it’s previous and next navigation:

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to edit the original gallery-feature of WP?’ is closed to new replies.