WordPress.org

Forums

[resolved] Change my theme to single column when viewing single photos (5 posts)

  1. Hannes
    Member
    Posted 6 years ago #

    I'm currently using the Gallery software for my photo gallery on my WordPress blog. It's nice, but since WordPress now has a pretty cool media library I'm thinking about starting to post my photos straight to WordPress (and stop using Gallery). But the content area in my current theme is pretty narrow and I would like to display big photos when people click one of the photos in the gallery.

    Is there a way I can change the theme to a single column (wider) when viewing single photos (attachments)?
    - maybe I can add some PHP code to my template that checks if category=gallery and then it loads a different CSS style (or adds a different CSS class to the content area) to make it one column (not load the sidebar)?

    If you want an example of what I'm looking for you can take a look at Matt Mullenweg's gallery: http://ma.tt/2008/09/day-in-davao/
    and how he displays single photos: http://ma.tt/2008/09/day-in-davao/mcm_8841/

    Any help appreciated :)

    - Hannes

  2. csleh
    Member
    Posted 6 years ago #

  3. Hannes
    Member
    Posted 6 years ago #

    Thanks! That's it - I don't have the image.php file in my theme because I made it myself a couple of years ago when that wasn't in the default theme.

    Thanks for the links - very helpful. I should be able to figure it out now...

  4. Hannes
    Member
    Posted 6 years ago #

    When I've inserted a gallery into a post the thumbnails link to something like this: http://www.example.com/?attachment_id=635

    Is that normal?
    How can I make permalinks for photos more readable (like on ma.tt)
    Permalinks for my blog posts are following this custom structure: /%year%/%monthnum%/%day%/%postname%

  5. Hannes
    Member
    Posted 6 years ago #

    OK, maybe I should have updated this - the thumbnails only linked to http://www.example.com/?attachment_id=635 when I was in preview mode - looking at a preview of the post. But once I had published the post the links to thumbnails followed the same permalink structure as blog posts.

Topic Closed

This topic has been closed to new replies.

About this Topic