• Resolved amrish

    (@sscgovtjobs)


    currently it is showing like regular posts in search result pages which is not needed as ut has shortcode display method.

Viewing 7 replies - 1 through 7 (of 7 total)
  • flowdee

    (@flowdee)

    Hey sscgovtjobs,

    thanks for your input. Indeed it should be removed. Going to fix this asap.

    Thread Starter amrish

    (@sscgovtjobs)

    thank you

    Thread Starter amrish

    (@sscgovtjobs)

    hi author . have you fixed it? thanks

    Not yet sorry but coming soon!

    Thread Starter amrish

    (@sscgovtjobs)

    hi admin can you tell the this custom post type name , so that i can exclude it. thanks

    Thread Starter amrish

    (@sscgovtjobs)

    hi guys i found one solution , first install ‘my custom functions‘ this plugin from wordpress plugin directory then activate and add collowing code in it.

    add_action( 'init', 'update_my_custom_type', 99 );
     
    function shapeSpace_filter_search($query) {
    	if (!$query->is_admin && $query->is_search) {
    		$query->set('post_type', array('post', 'page', 'affiliate-coupons'));
    	}
    	return $query;
    }
    add_filter('pre_get_posts', 'shapeSpace_filter_search');
    • This reply was modified 7 years, 8 months ago by amrish.

    Fixed with the latest update v1.1!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘exclude ‘ affiliate coupon ‘ custom post type from the wordpress default search’ is closed to new replies.