Okay
  Public Ticket #1812316
Search engine
Closed

Comments

  • François-Xavier started the conversation

    Hi,

    Do you have any tips/codes in order to include my Stachethemes events in the list of the search result (from the search bar in the7 Wordpress Theme) ?

    Thank you so much,

    F-X

  •  894
    Zhivko replied

    Add in your theme functions.php following filter:

    add_action('pre_get_posts', function($query) {
        if (!is_admin() && $query->is_main_query()) {
            if ($query->is_search) {
                $query->set('post_type', array('post', 'stec_event'));
            }
        }
    });

    Stachethemes Developer

  • François-Xavier replied

    Hi,

    It's working, thank you so much ! 

    F-X