No results from CPT when “WP file download” is installed

[ad_1]

Check that WP File Download does not set a post type restriction in the search.

If you can’t adjust this from WP File Download, you can always override it:

add_filter( 'relevanssi_modify_wp_query', function( $query ) {
  $query->set( 'post_types', array( 'post', 'page', 'your_cpt', 'other_post_type' );
  return $query;
} );

Thank you Mikko, this really works.

Do i manually have to list my CPT?

In the backend, relevanssi can detect all CPT. Can’t relevanssi set the filter by itself, so i don’t have to manually list the CPT again (as i already checked them in the backend)?

Well, none of this would be necessary, if WP File Download wouldn’t set its own post type restriction… so any complaints are best directed that way 😁 Without WPFD, this would just work, as there would be no post type restrictions in place, and the search would be based on the post types listed in the Relevanssi indexing settings.

Relevanssi can’t set this filter, because Relevanssi can’t tell which post types you want to include in the search. Yes, most of the time, all indexed post types are required, but not always, and Relevanssi can’t tell.

OK. Thanks again. You’re right.
I’ll give the support a hint.

I thought that Relevanssi could set the filter based on the CPT options set in the backend of relevanssi. There i define, which CPT should be searched or not.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer