• Resolved greanmurk

    (@greanmurk)


    Hello!

    Maybe I overlooked something, but standard Worpress search is not finding titles of the files I has added in the plugin. I’m very like the plugin, but this issue blocks me to use it.

    Any hints on this? I’m relatively new to WP, maybe it should be solved elsewhere.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter greanmurk

    (@greanmurk)

    Found a ways myself. First is adding code in theme functions.php:

    
    function my_add_post_type_to_search( $query ) {
    	if ( ! is_admin() && $query->is_main_query() && $query->is_search ) {
    		$query->set('post_type', array('page', 'post', 'bfd_download') );
    	}
    }
    add_filter( 'pre_get_posts', 'my_add_post_type_to_search' );
    

    Second is just changing “exclude_from_search” to false in the class-better-file-download-admin.php.

    Anyway, probably it’s worth to add an option to enable or disable files appearing in search results.

    Plugin Author ndhaddon

    (@ndhaddon)

    Hi,

    Im so glad that you got it sorted out and were nice enough to let everyone see how you did it.

    Cheers,

    Nik

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search in titles’ is closed to new replies.