WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. dodgerogers
    Member
    Posted 1 year 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

    http://wordpress.org/extend/plugins/ambrosite-nextprevious-post-link-plus/

  2. ambrosite
    Member
    Plugin Author

    Posted 1 year 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
    Member
    Plugin Author

    Posted 1 year ago #

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

    http://wordpress.org/support/topic/plugin-ambrosite-nextprevious-post-link-plus-links-not-showing-up-with-in_cats?replies=11

  4. dodgerogers
    Member
    Posted 1 year 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

About this Topic