• I want to create multiple events-list pages.

    I’ve already made an events-list page through the settings page with ‘events_search_form’ enabled.

    <?php
    /*
    Template Name: FindFreeConsultPersonal
    // Template for eventslist with events search form for personal topics
    */
    ?>
    
    <?php get_header(); ?>
    
    <?php
    global $EM_Event; // or use global $post
    ?>	 
    
    <h1 class="title">Title</h1>                  															
    
    <div class="search-results-events">									
    
    <div id="main">
    <?php
    the_content();
    ?>
    </div><!-- /#main -->
    
    </div><!-- /.search-results-events -->					
    
    <?php get_footer(); ?>

    This worked fine for me.

    Now, i want to create a separate page where business topics are listed, and certain topics in the search form are excluded.

    <?php
    /*
    Template Name: FindFreeConsultBusiness
    // Template for eventslist with events search form for business topics
    */
    ?>
    
    <?php get_header(); ?>
    
    <?php
    global $EM_Event; // or use global $post
    ?>	 
    
    <h1 class="title">Title</h1>                  															
    
    <div class="search-results-events">									
    
    <div id="main">
    <?php
    the_content();
    ?>
    </div><!-- /#main -->
    
    </div><!-- /.search-results-events -->					
    
    <?php get_footer(); ?>

    I’ve modified the category search a bit.

    <!-- START Category Search -->
    [...]
    <?php
    if ( is_page('personal')) {
    $selected = !empty($_REQUEST['category']) ? $_REQUEST['category'] : 0;
    EM_Object::ms_global_switch(); //in case in global tables mode of MultiSite, grabs main site categories, if not using MS global, nothing happens
    wp_dropdown_categories(array( 'exclude'=>'1,2,3,4', 'hide_empty' => 0, '));
    EM_Object::ms_global_switch_back(); //if switched above, switch back
    }
    else {
    
    if ( is_page('business')) {
    wp_dropdown_categories(array( 'exclude'=>'5,6,7,8', 'hide_empty' => 0, ); .......
    }
    
    }
    ?>
    </div>
    <!-- END Category Search -->

    http://wordpress.org/plugins/events-manager/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter bettercallsaul

    (@bettercallsaul)

    My question is how to create multiple events-list pages with different search form categories.

    Plugin Support angelo_nwl

    (@angelo_nwl)

    have you tried to use shortcode [event_search_form] or [events_list] ? or create a new shortcode instead which uses your custom templates.

    e.g.

    em_locate_template('templates/search/category-1.php',true)

    to use templates: http://wp-events-plugin.com/documentation/using-template-files/

    Thread Starter bettercallsaul

    (@bettercallsaul)

    I tried the [events_list], or better [events_list_grouped].

    <?php
    /*
    Template Name: FindFreeConsultBusiness
    // Template for eventslist with events search form for business topics
    */
    ?>
    <?php get_header(); ?>
    <?php
    global $EM_Event; // or use global $post
    ?>
    <h1 class="title">Title</h1>
    <div class="search-results-events">
    <div id="main">
    <?php
    echo do_shortcode('[event_search_form]');
    ?>
    <?php
    echo do_shortcode('[events_list_grouped]');
    ?>
    </div><!-- /#main -->
    </div><!-- /.search-results-events -->
    <?php get_footer(); ?>

    The list will be outputted correctly.

    However, your suggested shortcode [event_search_form], make the searchform not appear.
    When using this code it got a php warning:

    Warning: array_merge(): Argument #2 is not an array in C:\xampp\htdocs\wordpress\wp-content\plugins\events-manager\em-template-tags.php on line 303

    When I use [location_search_form] the form will appear. But when i want to do a search it will re-direct to my homepage with no search result.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    you’re right. this will get fixed in the next update.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    for now try this, the error will go away

    echo do_shortcode('[event_search_form test="x"]');

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘multiple events-list pages with different search form categories’ is closed to new replies.