only one result and result is wrong
-
I have set up the search and it all works except that the search result only shows one and the result is wrong.
I am using Advanced Custom Fields with this and have no idea how to change the results amount. If I search for all it only give me two pages of results and only with one result per page.
The page is https://workforce.strikingdesigns.com.au/events-workshops/
Thanks having lots of trouble getting it to show in the correct order as well.
This is in the functions:add_filter('uwpqsf_result_tempt', 'customize_output', '', 4); function customize_output($results , $arg, $id, $getdata ){ // The Query $apiclass = new uwpqsfprocess(); $query = new WP_Query( $arg ); ob_start(); $result = '10'; // The Loop if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post();global $post; locate_template( 'events-search.php', TRUE, TRUE ); } echo $apiclass->ajax_pagination($arg['paged'],$query->max_num_pages, 4, $id, $getdata); } else { echo 'no post found'; } /* Restore original Post Data */ wp_reset_postdata(); $results = ob_get_clean(); return $results; }
and this is in the event-search.php
<?php $start_date = DateTime::createFromFormat('Ymd', get_field('dates')); $end_date = DateTime::createFromFormat('Ymd', get_field('date_second')); $number = 0.00; $price = number_format($number, 2, '.', ''); ?> <ul class="event-list et_pb_equal_columns"> <li> <?php $dates = get_field( 'dates' ); ?> <?php if ( $dates ) { ?> <time datetime="<?php the_field( 'dates' ); ?>"> <span class="dayname"><?php echo $start_date->format('l'); ?></span> <span class="day"><?php echo $start_date->format('d'); ?></span> <span class="month"><?php echo $start_date->format('M'); ?> </span> <span class="year"> <?php //echo $start_date->format('Y'); ?> </span> </time> <?php } ?> <div class="info"> <span class="category"> <?php $terms_as_text = get_the_term_list( $post->ID, 'event_type', '', ', ', '' ) ; echo strip_tags($terms_as_text); ?> </span> <h2 class="title"> <?php the_title(); ?> </h2> <?php $presenter = get_field( 'presenter' ); ?> <?php if ( $presenter ) { ?> <?php } ?> <time datetime="<?php the_field( 'dates' ); ?>2"><span class="time"> <i class="fa fa-calendar" aria-hidden="true"></i> <?php echo $start_date->format('l'); ?> <?php echo $start_date->format('d'); ?> <?php echo $start_date->format('M'); ?> <?php echo $start_date->format('Y'); ?> <?php $date_second = get_field( 'date_second' ); ?> <?php if ( $date_second ) { ?> <strong class="hyphen"> - </strong> <?php echo $end_date->format('l'); ?> <?php echo $end_date->format('d'); ?> <?php echo $end_date->format('M'); ?> <?php echo $end_date->format('Y'); ?> <?php } ?> </span> </time> <?php $time = get_field( 'time' ); ?> <?php if ( $time ) { ?> <span class="time"><i class="fa fa-clock-o fa-fw" aria-hidden="true"></i> <?php the_field( 'time' ); ?> </span> <?php } ?> <?php $time_second = get_field( 'time_second' ); ?> <?php if ( $time_second ) { ?> <span class="time"><i class="fa fa-clock-o fa-fw" aria-hidden="true"></i> <?php the_field( 'time_second' ); ?> </span> <?php } ?> <span class="time"> <i class="fa fa-map-marker" aria-hidden="true"></i> <?php the_field( 'location' ); ?> <?php //$terms_as_text = get_the_term_list( $post->ID, 'event_region', '', ', ', '' ) ; //echo strip_tags($terms_as_text); ?> <?php //the_field( 'location' ); ?> </span> <p class="presenter"><strong>Presenter: </strong> <?php the_field( 'presenter' ); ?> <?php $uploaded_pdf_or_file = get_field( 'uploaded_pdf_or_file' ); ?> <?php if ( $uploaded_pdf_or_file ) { ?> <a href="<?php echo $uploaded_pdf_or_file['url']; ?>" /><?php echo$uploaded_pdf_or_file['title']; ?></a> <?php } ?> </p> <span class="event-price"><strong>Price: </strong> <?php if( get_field('price') == $number ) { echo "FREE"; } else { echo '$' . get_field('price') . ''; } ?> </span> <a href="<?php the_field( 'payment_url' ); ?>" target="_blank" class="product-buttons">REGISTER</a> </div> </li> </ul>
Thanks
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘only one result and result is wrong’ is closed to new replies.