• Resolved yolodesign

    (@yolodesign)


    For example, I have this custom query

    $args = array(
    ‘post_type’ => ‘resources’,
    ‘posts_per_page’ => 6,
    );
    $custom_query = new WP_Query( $args );

    Is it possible to return all custom posts types that are not excluded from search by this plugin?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor pronskiy

    (@pronskiy)

    Yes, this is possible.
    Let me verify, and I will come back with the code example soon.

    Plugin Contributor pronskiy

    (@pronskiy)

    Please try following code:

    
    $args = array(
        'post_type' => 'resources',
        'posts_per_page' => 6,
        'post__not_in' => get_option( 'sep_exclude', array() )
    );
    $custom_query = new WP_Query( $args );
    

    Let me know how it works for you.

    Thread Starter yolodesign

    (@yolodesign)

    It worked! Thank you!

    How can we do this for wp_list_pages()?

    Plugin Contributor pronskiy

    (@pronskiy)

    For wp_list_pages() you can do this in a similar way:

    
    wp_list_pages(array('exclude' => implode(',', get_option('sep_exclude', array()))));
    
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Is it possible to use this with a custom WP_Query?’ is closed to new replies.