WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to modify theme for that page where gallery pics are shown? (4 posts)

  1. WPChina
    Member
    Posted 6 years ago #

    The new gallery shortcode introduced in WordPress 2.5 is really nice, but how do I modify the individual page that is shown with just one pic.

    For example, Ma.tt has this page of pics:
    http://ma.tt/2008/08/start-conference-photos/

    but how do I modify the theme for an individual pic like this one:
    http://ma.tt/2008/08/start-conference-photos/mcm_5251/

    Tks!

  2. miloandrew
    Member
    Posted 6 years ago #

    good question! Out of the box, it seems to use the single.php page template, but clearly Matt's single pages are of a different template than his single gallery pages.

    A closer look at how the gallery works shows how the magic happens. You can select "link to page" for reach of the gallery entries, and if you do that, clicking on the thumbnails brings you to a new page that is only for that attachment. The attachment page will use the following templates in this order: attachment.php, single.php, index.php. For more info on attachments, surf over to:

    Using Image and File Attachments

    So, I'm betting that Matt simply made an attachment.php file and styled it for the images.

    I hope that helps! :)

    Cheers,
    Andy

  3. WPChina
    Member
    Posted 6 years ago #

    Perfect!! :)

  4. Simon3
    Member
    Posted 5 years ago #

    Wow, I love the theme on Ma.tt I'm new to php and WordPress, and Matt does a lot of awesome customizations that I'd like to figure out how to do.

    For instance, I really want to modify the Zack 990 theme so that on the image attachments pages I can have a text link ABOVE my photos that say "next picture" and "previous picture" in text. (Currently the theme has clickable photos at bottom and the text isn't an actual link -- or I could just copy it to the top).

    Here is an example of the unmodified theme's attachment page.

    Can someone help me with the code I need to insert to get a TEXT link to the next/last picture? Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic