• I have a custom post type that I want to be accessed only by direct link. The option “has_archive” is turned off. However, the previous and next links appear at the bottom of the detail page. I have searched for any setting in Types or Views that would let me get rid of them and I can’t find one. Am I just missing it? How do I resolve this simply?

    https://www.ads-software.com/plugins/types/

Viewing 2 replies - 1 through 2 (of 2 total)
  • You will need to modify your post archive template. This is usually archive.php. In this file your can comment out or modify the code to display/hide pagination.

    In TwentyFourteen Theme, you can find following line in your archive.php and can comment out, to disable paging altogether:

    twentyfourteen_paging_nav();

    change it like:

    //twentyfourteen_paging_nav();

    However, if you want to disable this for your particular post type, you can change that line with followings:

    if(get_post_type(get_the_ID()) != "my-cpt") {
    	twentyfourteen_paging_nav();
    }

    Remember to replace “my-cpt” with the correct slug of your CPT.

    You would also want to look into single.php for the following line:

    twentyfourteen_post_nav();

    You can do the same conditional test for this line as well.

    Note: Above code and idea is relevant to Twenty Fourteen theme. You may better check your theme documentation for appropriate page/post navigation functions and template files. Some themes can define their own methods, but apparently idea is the same.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Getting rid of previous and next links’ is closed to new replies.