• Resolved lwillisjhls

    (@lwillisjhls)


    Since the default search in WordPress is lacking, I wanted to know if the Display Posts plugin has any effect on the general search option when installed, or is it only for adding a shortcode to a specific page? I need to include events in my search (using Events Manager), but I don’t need to include past events. (I would also like to hide future events that are past 2-3 month away, if possible.)

    The page I need help with: [log in to see the link]

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

    (@billerickson)

    Display Posts does not affect the standard WordPress site search. You might check with Events Manager for the code to exclude past events from site search.

    Here’s an article I wrote on customizing the WordPress query. You’ll want to do something like this:

    
    add_action( 'pre_get_posts', 'be_event_search_query' );
    function be_event_search_query( $query ) {
    	if( $query->is_main_query() && ! is_admin() && $query->is_search() ) {
    
    		// Events Manager query customization goes here
    	}
    }
    
    Thread Starter lwillisjhls

    (@lwillisjhls)

    Thanks. I’ve reached out to Events Manager in hopes of getting some insight.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using plugin for native searches’ is closed to new replies.