-
AuthorSearch Results
-
June 20, 2017 at 10:33 am #115829
In reply to: Using CPT for search filter
AnonymousInactiveHi Trevor,
I have managed to get this working now, however, the code repeats itself and adds the month header on top of each event when it is meant to list all events of a single month in one header e.g all events in may should be listed under the may header but it currently adds the may header to each event in may. Please see below for code that is in the results.php file:
`
if ( $query->have_posts() ) { ?><div id=”tribe-events-content” class=”tribe-events-list”>
<div class=”events-loop tribe-events-loop vcalendar”>
<div class=”row”>
<div class=”tribe-events-page-title-wrap” style=”position: relative; text-align:center;”>
<h2 class=”tribe-events-page-title”>All Events</h2>
</div><?php while ($query->have_posts()) { $query->the_post(); ?>
<?php if ( ! defined( ‘ABSPATH’ ) ) { die( ‘-1’ ); } // Setup an array of venue details for use later in the template $venue_details=t ribe_get_venue_details(); if ( isset( $venue_details[ ‘linked_name’] ) ) { $venue_name=$ venue_details[ ‘linked_name’]; } elseif ( isset( $venue_details[ ‘name’] ) ) { $venue_name=$ venue_details[ ‘name’]; } else { $venue_name=” ; } // Venue $has_venue_address=( ! empty( $venue_details[ ‘address’] ) ) ? ‘ location’ : ”; // Organizer $organizer=t ribe_get_organizer(); ?>
<?php do_action( ‘tribe_events_inside_before_loop’ ); ?>
<!– Month / Year Headers –>
<?php tribe_events_list_the_date_headers(); ?><?php do_action( ‘tribe_events_inside_after_loop’ ); ?>
`
code for the event loop then goes here followed by:
`
<?php } else { echo ‘<div class=”upcoming-event-title” style=”padding:10px; background-color:#454545;”>
<p style=”text-align:center; color:white;”>
Oops! There are no events found matching your search selection. </p>
</div>’; } ?>
`
The main bit of code that makes the month header work is below:
`
<?php tribe_events_list_the_date_headers(); ?>
`
It may be easier to show you the code and explain the issue in a call if the this is confusing.
Thanks,
IhtezazJune 19, 2017 at 12:16 pm #115643In reply to: infinite scrolling problem
TrevorParticipantAre you using shortcode display results method? Yes?
Did you make a copy of the results.php template file and put this in your child theme folder:
In the plugin templates folder, there are 2 files; one contains the code if you want infinite scroll. You should use this one instead, but it should be renamed to results.php
June 19, 2017 at 9:41 am #115608
TrevorParticipantHi
To do the next steps, it would be best for you to be using the child theme, and for there to be a copy of the results.php file in that folder, and for the changes to be made to that. are you the client or developer in this?
June 18, 2017 at 8:21 am #115510
AnonymousInactiveYes!
Page url: http://www.sicilysheartandhome.com/search
I did upload the child theme, however will probably get a developer to help with the copy of the results.php template and add any code you give more for:
The button color
The results displaying as a grid/thumbnails like the home pageThanks again, and apologies on the delay in response.
June 15, 2017 at 4:54 pm #115260In reply to: Using CPT for search filter
AnonymousInactivePlease see below for the code in my theme that i want to implement:
<?php do_action( 'tribe_events_inside_before_loop' ); ?> <!-- Month / Year Headers --> <?php tribe_events_list_the_date_headers(); ?> <!-- Event --> <div id="post-<?php the_ID() ?>" class="<?php tribe_events_event_classes() ?> <?php echo esc_attr( $class ); ?>"> <?php tribe_get_template_part( 'list/single', 'event' ) ?> </div><!-- .hentry .vevent --> <?php do_action( 'tribe_events_inside_after_loop' ); ?>
I have placed this in the results.php file like so:
<?php if ( $query->have_posts() ) { ?> <?php while ($query->have_posts()) { $query->the_post(); ?> <?php do_action( 'tribe_events_inside_before_loop' ); ?> <!-- Month / Year Headers --> <?php /*<---THIS IS THE BIT I NEED WORKING */?> <?php tribe_events_list_the_date_headers(); ?> <!-- THIS BIT IS REPLACED WITH THE CODE ON THE RESULTS.PHP FILE TO OUTPUT THE SPECIFIC EVENTS--> <div id="post-<?php the_ID() ?>" class="<?php tribe_events_event_classes() ?> <?php echo esc_attr( $class ); ?>"> <?php tribe_get_template_part( 'list/single', 'event' ) ?> </div><!-- .hentry .vevent --> <?php do_action( 'tribe_events_inside_after_loop' ); ?>
end while and if statements.
June 15, 2017 at 4:05 pm #115227In reply to: Using CPT for search filter
AnonymousInactiveHi Trevor,
Thank you so much for your help. I have managed to get the search function working but I have now encountered another issue:
My theme has some code which displays the month an event is in on the main listing page. When I use the search filter, this is no longer visible. Could you please help me solve this? I have found the code that produces the listing by date from my theme but when I tried to add it into the results.php file, the page did not work as expected. I think it may be easier to show you the issue, as opposed to explaining it.
Also, the search results do not filter any upcoming events.
Thanks,
IhtezazJune 14, 2017 at 11:34 am #114932In reply to: Showing full content rather than summary
TrevorParticipantNormally you can change the appearance by editing the results.php file and adding your own theme’s CSS selectors and HTML structure.
What theme are you using?
June 14, 2017 at 7:21 am #114873In reply to: Showing full content rather than summary
TrevorParticipantYou will need to follow these customisation instructions:
Then you edit the results.php file you have copied, find this code block:
<p><br /><?php the_excerpt(); ?></p>
and replace it with this:
<div><?php the_content(); ?></div>
Note that you can edit this file quite extensively to add, modify PHP, HTML and CSS selectors.
June 12, 2017 at 10:06 am #114400In reply to: No results, no message appears
AnonymousInactiveHi,
Here is the results.php, but I have another for costumization.RESULTS.PHP
<?php /** * Search & Filter Pro * * Sample Results Template * * @package Search_Filter * @author Ross Morsali * @link http://www.designsandcode.com/ * @copyright 2015 Designs & Code * * Note: these templates are not full page templates, rather * just an encaspulation of the your results loop which should * be inserted in to other pages by using a shortcode - think * of it as a template part * * This template is an absolute base example showing you what * you can do, for more customisation see the WordPress docs * and using template tags - * * http://codex.wordpress.org/Template_Tags * */ if ( $query->have_posts() ) { ?> Found < ? php echo $query->found_posts; ?> Results <br/> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br/> <div class="pagination"> <div class="nav-previous"> <?php next_posts_link( 'Older posts', $query->max_num_pages ); ?> </div> <div class="nav-next"> <?php previous_posts_link( 'Newer posts' ); ?> </div> <?php /* example code for using the wp_pagenavi plugin */ if ( function_exists( 'wp_pagenavi' ) ) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> < ? php while ( $query->have_posts() ) { $query->the_post(); ?> <div style="display: inline-block; width:50%;"> <?php if ( has_post_thumbnail() ) { echo '<p>'; the_post_thumbnail("small"); echo '</p>'; } ?> </div> <div style="display: inline-block; width:50%;"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p> <?php the_category(); ?> </p> <p> <?php the_tags(); ?> </p> <p> <small> <?php the_date(); ?> </small> </p> <p><br/> <?php the_excerpt(); ?> </p> </div> < /div> <hr/> <?php } ?> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br/> <div class="pagination"> <div class="nav-previous"> <?php next_posts_link( 'Older posts', $query->max_num_pages ); ?> </div> <div class="nav-next"> <?php previous_posts_link( 'Newer posts' ); ?> </div> <?php /* example code for using the wp_pagenavi plugin */ if ( function_exists( 'wp_pagenavi' ) ) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> < ? php } else { echo "No Results Found"; } ?>
2553.PHP
<?php /** * Search & Filter Pro * * Sample Results Template * * @package Search_Filter * @author Ross Morsali * @link http://www.designsandcode.com/ * @copyright 2015 Designs & Code * * Note: these templates are not full page templates, rather * just an encaspulation of the your results loop which should * be inserted in to other pages by using a shortcode - think * of it as a template part * * This template is an absolute base example showing you what * you can do, for more customisation see the WordPress docs * and using template tags - * * http://codex.wordpress.org/Template_Tags * */ if ( $query->have_posts() ) { ?> <div style="float: left;"> <strong> <?php echo $query->found_posts; ?> </strong> resultado(s)</div> <div style="float: right;">Pág. <?php echo $query->query['paged']; ?> de <?php echo $query->max_num_pages; ?> </div> <div style="clear: both;"></div> <hr> <div class="pagination" style="width: 100% !important;"> <div style="float: right;"> <?php next_posts_link( '<span class="ion-arrow-right-c"></span>', $query->max_num_pages ); ?> </div> <div style="float: left;"> <?php previous_posts_link( '<span class="ion-arrow-left-c"></span>' ); ?> </div> <div style="clear: both;"></div> <?php /* example code for using the wp_pagenavi plugin */ if ( function_exists( 'wp_pagenavi' ) ) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> <div style="clear: both;"></div> < ? php while ( $query->have_posts() ) { $query->the_post(); ?> <div style="float: left; width: 50%; padding-bottom: 50px;"> <?php if ( has_post_thumbnail() ) { echo '<p>'; the_post_thumbnail("small"); echo '</p>'; } ?> </div> <div style="float: left; width: 50%; padding-left: 20px; padding-bottom: 50px;"> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <p> <?php echo do_shortcode('[pods field="resumo_objectivos"]'); ?> </p> <p> <?php echo do_shortcode('[pods field="datas"]'); ?> </p> <p> <?php echo do_shortcode('[pods field="preco"]'); ?> </p> <p> <?php echo do_shortcode('[pods field="duracao"]'); ?> </p> </div> <hr/> <div style="clear: both;"></div> < ? php } ?> <div class="pagination" style="width: 100% !important;"> <div style="float: right;"> <?php next_posts_link( '<span class="ion-arrow-right-c"></span>', $query->max_num_pages ); ?> </div> <div style="float: left;"> <?php previous_posts_link( '<span class="ion-arrow-left-c"></span>' ); ?> </div> <div style="clear: both;"></div> <?php /* example code for using the wp_pagenavi plugin */ if ( function_exists( 'wp_pagenavi' ) ) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> <div style="clear: both;"></div> < ? php } else { echo "Não foram encontrados resultados"; } ?>
June 12, 2017 at 9:40 am #114394In reply to: No results, no message appears
TrevorParticipantI would need to see the results.php file.
If you paste it here, please make it a ‘code block’ by putting a back tick before and after the code (it is the key on the left of the ‘1’ key on most keyboards:
-
AuthorSearch Results