• Resolved gunda mahesh

    (@gunda-mahesh)


    hi,
    i just want to know, how can we only include selective post or page IDs for related post to display, rather to exclude a heavy list of 100 to 200 post and pages.

    in settings i have seen an option to exclude IDs. i want to know is there a option to include or writing a code can do the job

    please help

    https://ww.wp.xz.cn/plugins/contextual-related-posts/

Viewing 1 replies (of 1 total)
  • Plugin Author WebberZone

    (@webberzone)

    On the include option, that’s something not yet present in the plugin. It will be there but on a post by post basis only.

    On the code, you could potentially do this with this function in your functions.php. Please note it hasn’t been tested. Change the 100, 50, 90 to the IDs you want

    function filter_crp_posts_where( $where) {
       $where .= " OR $wpdb->posts.ID IN ( 100, 50, 90 ) ";
       return $where;
    }
    apply_filters( 'crp_posts_where', 'filter_crp_posts_where' );
Viewing 1 replies (of 1 total)

The topic ‘Include post or page IDs rather Exclude’ is closed to new replies.