• Resolved soundforscher

    (@soundforscher)


    Hey Guys,

    i try to separate some categories or posttypes from the “nex/previous post” on the top of the sidebar.

    i tried to modify the post-nav.php
    But if i add something to the php code – the full block is removed from the site.

    that is what i tried (i should mention, that i am a try-and-error php noob)
    i added ‘post_format’ to show only posts with the same post-type.
    result: block removed from the site.
    <?php if ( is_single() ): ?>
    <ul class=”post-nav group”>
    <li class=”next”><?php next_post_link(‘%link’,'<i class=”fa fa-chevron-right”></i>‘.__(‘Next Story’, ‘hueman’).’ <span>%title</span>’,’post_format’); ?>
    <li class=”previous”><?php previous_post_link(‘%link’,'<i class=”fa fa-chevron-left”></i>‘.__(‘Previous Story’, ‘hueman’).’ <span>%title</span>’); ?>

    <?php endif; ?>

    i also tried some of this instructions, with the same result
    https://codex.wordpress.org/Function_Reference/previous_post_link

    i am sure, that i make a mistake and hope anyone can help me

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi soundforscher. Couple of things:
    1. You’re missing the closing tags on the two list items.
    2. If you look at the Within Same Taxonomy section of the Codex link you posted you’ll see that there are two optional parameters before the ‘post-format’ taxonomy paramenter you added. You need to provide values, or blank placeholders, for those two parameters since you’re using a parameter after them.

    Thread Starter soundforscher

    (@soundforscher)

    thank you for your reply !
    it opened my eyes 🙂

    now i exclude a specific category, and it works.

    Thank you very much.

    You’re welcome. IF you don’t need any further assistance here please mark the topic as Resolved. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Page Nav / Sidebar’ is closed to new replies.