Home Forums Art WordPress Theme Exclude categories from next/prev on single-page

This topic contains 2 replies, has 2 voices, and was last updated by  reframing 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14005

    reframing
    Participant

    I’d like to exclude some categories (f.e. “sliders”) from the next/prev-buttons on the single-post-pages. Is this possible?

    #14008

    BWSM
    Keymaster

    Hi,

    Please change the 4 places as for /template/single/content-navi.php:

    line2, replace as:
    $prev_post = get_previous_post(false, '232');
    line4, replace as:
    $next_post = get_next_post(false, '232');
    line38, add the codes:
    'exclude' => '232',
    line48, add the codes:
    'exclude' => '232',

    it should be(refer screenshot):
    https://www.dropbox.com/s/hri71u18h91m6p2/QQ20171127-120559%402x.jpg?dl=0

    232 is category ID what you want to exclude, you should change it as yours.
    How to find it?
    Edit the category in wp-admin, you will see the ID on URL >> https://www.dropbox.com/s/vakv2o7iqlsy59o/QQ20171127-120853%402x.jpg?dl=0

    Regards!
    Bwsm – uiueux.comTwitterFacebook

    #14012

    reframing
    Participant

    Great! It works very well!

    You made my day! 🙂 & Thanks a lot!

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

You must be logged in to reply to this topic.