Support » Fixing WordPress » posts_nav_link add the in_same_cat parameter PLS

  • csgoboosting

    (@csgoboosting)


    I want to be able to provide links to the previos and next post from THE SAME category while the user is viewing an individual post, but I can only do that with the previous_post_link() and next_post_link() functions, because only they support the checking parameter called in_same_cat.

    I am ok to use those two functions, but they do not have the functionality I need – the sep parameter which serves to display text between the two links.

    Here’s what I currently use:
    <?php previous_post_link(‘%link’, ‘« Watch Previous ‘ . $category_name . ‘ Episode’, TRUE); ?> —
    <?php next_post_link(‘%link’, ‘Watch Next ‘ . $category_name . Overwatch Boosting ‘ Episode »’, TRUE); ?>
    So I am using “—” as text between the two links, but when there is no next or previous post in the category, the displayed text is like this:
    « Watch Previous Weeds Episode —, thus – the unneded triple dash.

    The page I need help with: [log in to see the link]

  • The topic ‘posts_nav_link add the in_same_cat parameter PLS’ is closed to new replies.