• Resolved polychromatic

    (@polychromatic)


    When I enable ‘Recipes Act as Posts’, my search results on the website completely change. I no longer get any of my website’s pages in search results – only posts.

    Any ideas as to why my search results are changing due to this option? This is an urgent issue for us, as I will now be forced to recreate all of the recipe posts as normal posts, and then embed the recipes using shortcodes.

    Thank you in advance!

    https://www.ads-software.com/plugins/wp-ultimate-recipe/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Brecht

    (@brechtvds)

    Try adding the following code to your theme’s functions.php file. That should make sure recipes, posts and pages appear in the search results:

    function wpurp_search_results( $query ) {
    if ( $query->is_search ) {
    $query->set( 'post_type', array( 'post', 'page', 'recipe' ) );
    };
    return $query;
    };
    add_filter( 'pre_get_posts', 'wpurp_search_results' );
    jream

    (@jream)

    Thank you for this. The plugin does cause a conflict with the search. This solution corrects the problem.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘'Recipes Act as Posts' Alters Search Results (Removes Pages)…’ is closed to new replies.