• Hello,

    I am setting up a photoblog-type wordpress, and I am currently stuck… Here is where I am :

    Example:
    My category-5.php page acts as a gallery, displaying thumbnails of my posts (using “Get The Image” Plugin)

    As per the “Get The Image” default behaviour, clicking on a thumbnail brings you to that post’s permalink. This is fine, except I want it to act like a traditional gallery, meaning, when you click on a thumbnail it shows the entire post, but also has “next” and “previous” links to view the next and previous posts in that category.

    The problem is I see no way of putting those next and previous links on that page since it is the permalink page. The only possibility I see is (somehow)using the “Get The Image” plugin to point that thumbnail to a different category-5.php page where it displays that post with next and previous links….

    Any Ideas?

    Thanks,

    Ian

Viewing 4 replies - 1 through 4 (of 4 total)
  • You should be able to use the following two functions in your single.php:

    if( in_category( 5 ) ) {
      next_post_link( $format='%link »', 'Next', true );
      previous_post_link( $format='« %link', 'Previous', true );
    }

    Thread Starter enthewhite

    (@enthewhite)

    Thank you for the reply. I found this code, but what if you navigate to that same post from a different category? Then the previous and next buttons would take you to the wrong category.

    Is there a (simple) way for the single.php page to “know” from which category it came from?

    I have searched through many photoblog themes for WP and none of them seem to have figured out this categorical functionality I am wanting.

    There is only one case in which I found that the above code will not work and that’s when you put a post in more than one category. Is this what is throwing you off? If so, I would strongly suggest only using one category per post – I know that this idea appears limiting to many bloggers, but I have found it to be a reliable way to “work with” WordPress’s built in functionality. If you need to further “categorize” your posts, I suggest that you use tags.

    I realize that this solution may not be for everyone, but I have been using WordPress for about 3.5 years and this is the only solution that has worked.

    Hope this helps,
    -Mike

    Thread Starter enthewhite

    (@enthewhite)

    I appreciate the help, Mike.

    I do want to be able to put a post in more than one category, but I think if my idea below works, then I shouldn’t have to worry about that (unless there are other built in functions that I should worry about with multiple categories?)

    How about something like this:

    You go to category-5 page where the category-5.php uses the loop to call the latest post in that category in full content at the top (looks the same as it would on its permalink page), then the rest of the posts in that category in thumbnails below it (something like the “mullet” loop).

    If my understanding is correct, a posts_nav_link on this page would cycle through only the posts in this category. So, if one of the thumbnails on this category page is clicked, then instead of going to the associated post’s permalink, could it simply change the loop so that post would then be on top in full content and the rest below it in thumbnails?

    I’m not really sure how it would “change” the loop like that on the category-5.php, but logically it seems like something like this should work.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Alternative to Get The Image?’ is closed to new replies.