Ambrosite Next/Previous Post Link Plus
[resolved] 'in_cats' not rendering any links (4 posts)

  1. dodgerogers
    Posted 2 years ago #

    Hi ambrosite,

    Again thanks for a great plugin! I am just having an issue using 'in_cats'. I have a post structure like so:

    Parent 1 -
    Sub-category 1-
    Post - News

    Parent 2-
    Sub-category 1-
    Post - Worldview

    I would like to navigate through all the posts that belong to a posts' parent category. So for the News post, I would like to cycle through the posts in category Parent 1.

    I have the following code that retrieves the parent categories id:

    <?php $cats = get_the_category(); ?>
    <?php $rents = $cats[0]->category_parent; ?>
    <?php echo $rents;?>

    -> returns 58 in this instance, which is correct.

    <?php previous_post_link_plus( array('in_cats' => $rents ) ); ?> |
    	<?php next_post_link_plus( array('in_cats' => $rents ) ); ?>

    However, nothing is rendered using this code, am I missing anything?

    Thanks in advance


  2. ambrosite
    Plugin Author

    Posted 2 years ago #

    Are your posts actually assigned to the parent category? Or only to the subcategories? The in_cats parameter will not work unless the posts are assigned directly to the category number(s) specified.

  3. ambrosite
    Plugin Author

    Posted 2 years ago #

    A similar question was raised in this thread. You might try the solution I posted there.


  4. dodgerogers
    Posted 2 years ago #

    oh I see, yeah because of some custom inherited backgrounds my posts are only listed in the sub category and not the parent category. Ill check the other thread out.

    Thanks for the quick reply!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Ambrosite Next/Previous Post Link Plus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic