Exclude Custom post type from /blog page

Question

Custom post type name is “project”. I need code in functions.php

This is working for search:

// Exclude custom post type from  WP Search
add_action( 'init', 'update_my_custom_type', 99 );
function update_my_custom_type() {
    global $wp_post_types;

    if ( post_type_exists( 'project' ) ) {
        // exclude from search results
        $wp_post_types['project']->exclude_from_search = true;
    }
}

I can not find a solution for /blog page.

0
Branko Todorović 2 months 2021-10-11T16:36:29-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse