Event Search form doubly displayed when used in template

WordPress Event Management, Calendars & Registration Forums General Question Event Search form doubly displayed when used in template

This topic contains 2 replies, has 2 voices, and was last updated by  Bond Nwonye 8 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23317

    Hi Stephen,

    In my child theme, I used the

    <?php echo eo_get_event_search_form(); ?>

    in the file eo-events-nav to display the event search form. The problem is that the form is displayed twice at the top and twice at the bottom of page (making it a total of 4 forms). Obviously, the form is coded to display both at the top and bottom of page, which is fine. But even if meant to display at top and bottom of page, I would like it to display only one form at the top and one at the bottom, instead of being doubly displayed both ways. Below is my entire page code:

    
    <?php
    global $wp_query;
    if ( $wp_query->max_num_pages > 1 ) { ?>
    <!--begin my customization--->
    <div style="margin-bottom:40px"><?php echo eo_get_event_search_form(); ?></div>
    <!--end my customization--->
    <nav class="eo-events-nav">
        <div class="nav-next eo-events-nav-later"><?php next_posts_link( __( 'Later events ' , 'eventorganiser' ) ); ?></div>
        <div class="nav-previous eo-events-nav-earlier"><?php previous_posts_link( __( '  Newer events', 'eventorganiser' ) ); ?></div>
    </nav><!-- #nav-above -->
    <?php };
    
    

    Any help on this would be appreciated.

    Bond Nwonye
    #23320

    Hi Bond,

    By default, eo_get_event_search_form() prints the (and returns) the mark-up. So you can remove the echo command. That should fix the form appearing four times rather than the intended two.

    Stephen Harris
    #23321

    Hi Steven,

    Thanks. It solved the problem.

    Bond Nwonye
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.