WordPress.org

Ready to get started?Download WordPress

Forums

next/previous posts link - category children (11 posts)

  1. sparkletack
    Member
    Posted 6 years ago #

    I need "next/previous post" links that will direct users to the next post in the child of a category.

    In the codex I've found links that work within a category, but don't see how to set it up to work with the individual children.

    Can it be done?

  2. sparkletack
    Member
    Posted 6 years ago #

    Did I phrase this in a confusing way?

    I have a list of links in my sidebar which are all child links of a single category.

    The way it is now, when you click on one of the child links and end up on a single-post page, using the "next/previous" links takes the user to the next post in the *category*, which is not necessarily the next "child" of that category.

    Is there some way to set it up so that the "next/previous" links stay within the child category?

    (www.calyxdesign.com/portfolio is where I'm trying to make this happen.)

  3. sparkletack
    Member
    Posted 6 years ago #

    Bump ... if this is being ignored because I've explained it poorly, lemme know and I'll give it another try.

  4. thelittlestgiant
    Member
    Posted 5 years ago #

    Bump... I need this too. Anyone have any ideas?

    Thanks :)

  5. heriz
    Member
    Posted 5 years ago #

    Yep, I'm in desperate need of this, too.

    Maybe something needs to be changed in wp-includes/link-template.php?

    Nothing I've tried does anything, though.

    I'm also having a strange issue with listed subcategory posts in the sidebar. To begin with, all subcategory post titles are listed - but when you get so far down the list, the remaining title links disappear, and the only thing you can do is click on the next-post link which takes you to the first post in the next subcategory.

    I'm guessing this could be something to do with the date stamps, or the post count... but I don't know.

    Here's what I have in the sidebar section that lists the subcategory titles:

    <?php
    
    	$IDOutsideLoop = $post->ID;
    	global $post;
    
    	 $myposts = get_posts('showposts=100&category=175');
    	 foreach($myposts as $post) :
    	 ?>
    		<li<?php if(is_single() && $IDOutsideLoop == $post->ID) print ' class="current-post-item"'?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    
    <?php endforeach; ?>

    Any ideas anyone?

  6. heriz
    Member
    Posted 5 years ago #

    That last bit seems to be either a browser cache issue, or something to do with the database. I've still not worked it out, but it's not related to the previous problem.

  7. greggo
    Member
    Posted 5 years ago #

    I'll add my bounce to this.

  8. Cokomon
    Member
    Posted 5 years ago #

    I also would like to know how to do this. Currently, I am running ComicPress, so all of my comics are under the Comic category. However, I have subcatagories for the comics and would like to have Previous / Next links that take the reader from the previous comic in the category to the next, skipping any in between that are not in the same sub category.

  9. sparkletack
    Member
    Posted 5 years ago #

    Well, it's been eight months since I asked the question ... if what we're trying to accomplish here is impossible, would someone mind just putting us out of our misery and telling us so?

  10. fas.khan
    Member
    Posted 5 years ago #

    Well ... guess WordPress community is not that helpful as it was once!

  11. abelb
    Member
    Posted 5 years ago #

    i found a plugin that might do what you are trying to do:

    http://gobecky.net/2008/10/06/prev-next-by-cat/

Topic Closed

This topic has been closed to new replies.

About this Topic