WordPress.org

Ready to get started?Download WordPress

Forums

Next / Prev post: "excluded_category " doesn't work? (2 posts)

  1. Val S
    Member
    Posted 7 years ago #

    Hello all,

    I'm modifying a theme and have been trying to set it up to filter out one category of posts when browing next/prev from the single posts.

    Using the guide here:
    http://codex.wordpress.org/Template_Tags/next_post

    I have this code snippet in "single.php":

    <?php next_post('%', '&laquo;', 'no', 'no', '', '24'); ?>

    Which I thought should keep someone from browsing past entries in category ID 24, but I just threw up a test post in that cat and I can still click my way to it from the earlier entry.

    Using WP version 2.0.4. Am I missing something here?

  2. dannybcastillo
    Member
    Posted 7 years ago #

    http://wordpress.org/support/topic/53952?replies=10
    has covered this topic.

    Download
    template-functions-links.php
    Just scroll to bottom for the zip file. Then upload the extracted file to wp/wp-includes dir.

    Change in Single PHP
    <?php previous_post_link('« %link', '%title', false, '2') ?>
    <?php next_post_link('%link »', '%title', false, '2') ?>

Topic Closed

This topic has been closed to new replies.

About this Topic