Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25073

    We are creating a highly customized version of your theme for a client and I need to know where the code for the previous and next post is stored. We need to two only show previous and next in the same category? Right now if you are in a custom property listed for like real estate, when you get to the last property it will show the next post in the news.

    #125693

    The function can be found in functions-coherence.php:

    if(!function_exists('avia_post_nav'))
    {
    function avia_post_nav()
    {
    $output = "";
    ob_start();
    ?>
    <div class='post_nav_container stretch_full'>
    <div class='post_nav'>
    <div class='previous_post_link_align'>
    <?php previous_post_link('<span class="previous_post_link">← %link </span><span class="post_link_text">'.__('(previous entry)','avia_framework'))."</span>"; ?>
    </div>
    <div class='next_post_link_align'>
    <?php next_post_link('<span class="next_post_link"><span class="post_link_text">'.__('(next entry)','avia_framework').'</span> %link →</span>'); ?>
    </div>
    </div> <!-- end navigation -->
    </div>
    <?php

    $output = ob_get_clean();
    return $output;
    }
    }

    I checked the documentation: http://codex.wordpress.org/Function_Reference/previous_post_link and it seems like you can restrict it to the current category with a parameter. However it won’t work with custom post types (including the portfolio).

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Previous and Next Post Navigation’ is closed to new replies.