Forums

next_post_link not interpreting all the passed parameters? (3 posts)

  1. steveportigal
    Member
    Posted 1 year ago #

    My entire site is hosted in WP. The main page is at http://www.portigal.com and the blog is at http://www.portigal.com/blog.

    Posts in the News category are displayed on the main page, and posts in the Blog category are on the /blog page.

    I recently learned about previous_post_link and next_post_link and got 'em working fine.

    <div id="nav-below" class="navigation">
    <div class="nav-previous">
    <?php previous_post_link(__('&laquo; %link')) ?></div>
    <div class="nav-next"><?php next_post_link(__('%link &raquo;')) ?></div></div>

    But then I posted to the News category and realized that the links - on the main blog - were going to mess up since they went to posts that are NOT previous or next on that page. But they are different categories, so I edited the code

    <div id="nav-below" class="navigation">
    <div class="nav-previous">
    <?php previous_post_link(__('&laquo; %link', TRUE)) ?></div>
    <div class="nav-next"><?php next_post_link(__('%link &raquo;', TRUE)) ?></div></div>

    But nothing changed; single posts in the Blog category still showed a previous link to a post in the News category.

    I added the code to exclude the News category (redundant, but what the heck)

    <div id="nav-below" class="navigation">
    <div class="nav-previous">
    <?php previous_post_link(__('&laquo; %link', TRUE, '2')) ?></div>
    <div class="nav-next"><?php next_post_link(__('%link &raquo;', TRUE, '2')) ?></div></div>

    Also didn't have any effect. All three versions of code produce the same result.

    I'm sure I'm missing something (and I'm sure I failed to provide some info here) - your help appreciated!

  2. Alber
    Member
    Posted 1 year ago #

    Confirm this problem.

    I have in my template:
    <?php previous_post_link('&laquo; %link', TRUE) ?>
    or
    <?php previous_post_link('&laquo; %link', TRUE, '') ?>
    or
    <?php previous_post_link('&laquo;', '%link', TRUE) ?>

    This gives me no wanted results (links within one category).
    WP 2.3.2

  3. Alber
    Member
    Posted 1 year ago #

    anybody? somebody?

Topic Closed

This topic has been closed to new replies.

About this Topic