• Resolved fersamp

    (@fersamp)


    Hi guys,
    I can’t run event search filter in a tabbed page in my home page:
    here the example
    https://www.dayroma.it/wp-content/uploads/2016/03/search.jpg

    I set from date and to date, then I click the search button but events list in tabbed page is not refreshed filtered.

    I made this custom filter through this code:

    function display_custom_search( $attr, $content = null ) {
    
    	$search_args = em_get_search_form_defaults();
    	em_locate_template('templates/events-search.php', true, array('args'=>$search_args));
    
    	$args['limit'] = !empty($args['limit']) ? $args['limit'] : get_option('dbem_events_default_limit');
    						if( !empty($args['ajax']) ){ echo '<div class="em-search-ajax">'; } //AJAX wrapper open
    						if( get_option('dbem_event_list_groupby') ){
    							em_locate_template('templates/events-list-grouped.php', true, array('args'=>$args));
    						}else{
    							em_locate_template('templates/events-list.php', true, array('args'=>$args));
    						}
    						if( !empty($args['ajax']) ) echo "</div>"; //AJAX wrapper close
    
        /*return '<a href="http://twitter.com/filipstefansson" class="twitter-button">' . $content . '</a>';*/
    }
    add_shortcode('custom_search', 'display_custom_search');

    If this code is wrong, how can I filter events in my home page?

    Thank you everyone

    https://ww.wp.xz.cn/plugins/events-manager/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    can I know where did you find custom_search filter? also, maybe this tutorial can help you out – http://wp-events-plugin.com/tutorials/

    Thread Starter fersamp

    (@fersamp)

    Hi angelo_nwl,
    I extracted that code from em-events.php line 56.

    It worked before I added ajax=1 in the first tab for another filter.

    Thank you for tutorial link, but I can’t find what I need: I found “Adding Custom Event Search Form Fields” tutorial, this only “add a field to the search form so visitors can search and filter events by Style”.

    I need instead to use search form in my home page, do you know some code I could use?

    Really thank you for your precious help

    Plugin Support angelo_nwl

    (@angelo_nwl)

    try to use shortcode [event_search_form ajax=1]

    Thread Starter fersamp

    (@fersamp)

    After months of hard work, I finished my events tab filters…. it WORKS EVERYTHING.

    REALLY THANK YOU ANGELO_NWL 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Custom event filter’ is closed to new replies.