Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Search on my website

  • Thanks Ying, For a simpler search

    how could I use this code to search only in a bbpress forum topic? Do I need to overwrite any functions?

    function search_filter( $query ) {
        if ($query->is_search && !is_admin()) {
             $query->set('post_type', array('topic, forum'));
             $query->set('orderby', 'date');
             $query->set('order', 'ASC');
        }
    }
    add_filter('pre_get_posts', 'search_filter', 10, 2);
  • The code looks about right.

    Just make sure you don’t have other function called search_filter.

Viewing 2 posts - 17 through 18 (of 18 total)
  • You must be logged in to reply to this topic.