-
AuthorSearch Results
-
September 2, 2016 at 1:50 pm #56455
In reply to: Extra space in search results
AnonymousInactive<?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 style="width:100%;"> <?php while ($query->have_posts()) { $query->the_post(); ?> <div class="result"> <?php if (get_field('property_main_image') != '') { ?> <img />" alt="" width="400px" /> <div class="status"><?php echo get_field('status'); ?></div> <div class="details"> <?php echo '<h4>$' . get_field('price') . ' </h4>'; echo '<p>' . get_field('address') . '<br>'; echo get_field('city') . ', '; echo get_field('state'); echo get_field('zip') . '</p>'; echo '<p class="spex">' . get_field('bedrooms') . ' BEDROOMS | '; echo get_field('bathrooms') . ' BATHROOMS<br>'; echo '<span class="secondline">' . get_field('square_footage') . ' SQ FT | '; echo get_field('garages') . ' CAR GARAGE</span>'; echo '<span>MLS# ' . get_field('MLS') . '</span></p>';?> <div class="linx"> <a href="#"><img src="/CreativeHomes/wp-content/uploads/2016/08/CH_Button_Photos_Grey.png" alt="see photo gallery" /></a> <a target="_blank">"><img src="/CreativeHomes/wp-content/uploads/2016/08/CH_Button_MapPin_Grey.png" alt="google map for location" /></a> <a target="_blank">"><img src="/CreativeHomes/wp-content/uploads/2016/08/CH_Button_Collateral_Grey.png" alt="brochure download" /></a> </div><!--end linx--> <a>"><img src="/CreativeHomes/wp-content/uploads/2016/08/details-button.png" width="122" alt="details" /></a> </div><!--end details--> <div class="interact"> <span><?php the_favorites_button($post_id, $site_id); ?></span> <span><img src="/CreativeHomes/wp-content/uploads/2016/08/check-icon.jpg" />Compare</span> <span><?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_KIT' ) ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>Share</span> </div><!--end interact--> </div><!--end result--> <?php } ?> </div> <?php } else { echo "No Results Found"; } ?>
September 1, 2016 at 11:31 am #56333In reply to: Getting started with styling the results template
TrevorParticipantHere is the ‘starter’ results.php for your Thrive theme:
<?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> <div class="scbgi tt-search-results-posts-container" id="tt-search-results-container"> <?php while ($query->have_posts()) { $query->the_post(); ?> <div class="scc left"> <?php if ( has_post_thumbnail() ) { ?> <a class="rmich" href="<?php the_permalink(); ?>"> <div class="rimc" style="background-image: url(' <?php the_post_thumbnail_url("small");?> ')"></div> </a> <?php } ?> <div class="scbt"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p><br /><?php the_excerpt(); ?></p> <p><?php the_category(); ?></p> <p><?php the_tags(); ?></p> <p><small><?php the_date(); ?></small></p> </div> </div> <?php } ?> </div> 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"; } ?>
Let me know how you get on and if I can close the thread?
August 24, 2016 at 12:11 pm #55492In reply to: customizing search result style
TrevorParticipantA customized results.php for you:
<?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> <ul class="penci-grid"> <?php while ($query->have_posts()) { $query->the_post(); ?> <li class="list-post"> <article id="post-3238" class="item"> <div class="thumbnail"> <?php if ( has_post_thumbnail() ) { echo '<p>'; the_post_thumbnail("thumb"); echo '</p>'; } ?> </div> <div class="content-list-right content-list-center"> <div class="header-list-style"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> </div> <div class="item-content"> <p><br /><?php the_excerpt(); ?></p> </div> </div> </article> </li> <?php } ?> </ul> 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"; } ?>
August 23, 2016 at 10:38 am #55335In reply to: customizing search result style
TrevorParticipantIt is much easier for me if you show me a live sample page that uses the template as you want, and the live search results page as it is now.
August 12, 2016 at 11:31 am #54405In reply to: filter results-posts formatting gets lost
TrevorParticipantHi
You appear to be using the shortcode results method. Did you make the custom copy of the results.php template file, as documented here?
It will not fix the issue, but it is where we start from. I have not made one for Enfold before, but anything is possible. Do you have a sample page of what you want it to look like (on your site or the theme demo pages)?
August 11, 2016 at 8:57 am #54248In reply to: Loading results on the same page
TrevorParticipantI didn’t delete the css, but as the page has changed also some CSS may need to be re-written. The form element headings are in the form UI bits you dragged and dropped into the form. Look for the option
Add a heading?
Once you have added all the bits you need, make a screenshot and play with it by cutting and pasting where you want stuff, what want to be bigger, smaller, different font/size and link to it here. I can then advise.
For those others who might use the Hemlock theme from Solo Pine Designs, this is the customized results.php I wrote:
<?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() ) { ?> <ul class="sp-grid"> <?php while ($query->have_posts()) { $query->the_post(); ?> <li> <article id="post-<?php the_ID();?>" class="item"> <?php if ( has_post_thumbnail() ) { ?> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail("thumb");?></a> <?php } ?> <div class="item-content jpibfi_container"> <span class="cat"><?php the_category(", "); ?></span> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <input class="jpibfi jpibfi-ignore" data-jpibfi-url="<?php the_permalink(); ?>" data-jpibfi-description="<?php the_title(); ?>" type="hidden"><span class="more-button"><a class="more-link" href="<?php the_permalink(); ?>">Read More</a></span> <br /><span class="date"><?php the_date(); ?></span> </div> </article> </li> <?php } ?> </ul> <div class="pagination"> <div class="older"><?php next_posts_link( 'OLDER POSTS <i class="fa fa-angle-double-right"></i>', $query->max_num_pages ); ?></div> <div class="newer"><?php previous_posts_link( '<i class="fa fa-angle-double-left"></i> 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"; } ?>
August 10, 2016 at 1:16 pm #54101In reply to: Customize result.php with table
TrevorParticipantas I haven’t heard back from you I hope all is OK? This results.php below works in Divi. The user wanted the results in a column that was 75% of the page width, the search form was in a sidebar in the other 25%.
The pavigation and post titles are full width, and the content is thumb to the left and excerpt to the right, taking up 1/3 and 2/3 of the 75% column width:
<?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 class="et_pb_text et_pb_module et_pb_bg_layout_light et_pb_text_align_center"> <?php echo $query->found_posts; ?> gefundene Ergebnisse<br /> Seite <?php echo $query->query['paged']; ?> von <?php echo $query->max_num_pages; ?><br /> <div class="pagination"> <div class="nav-previous"><?php next_posts_link( 'Seite zurück', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Seite vor' ); ?></div> <?php /* example code for using the wp_pagenavi plugin */ if (function_exists('wp_pagenavi')) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> </div> <?php while ($query->have_posts()) { $query->the_post(); ?> <div> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <div class="et_pb_row_inner et_pb_row_1-4_1-2"> <div class="et_pb_column et_pb_column_1_4 et_pb_column_inner"> <div class="et_pb_text et_pb_module et_pb_bg_layout_light et_pb_text_align_left"> <?php if ( has_post_thumbnail() ) { echo '<a href="'; the_permalink(); echo '">'; the_post_thumbnail("small"); echo '</a>'; } ?> </div> </div> <div class="et_pb_column et_pb_column_1_2 et_pb_column_inner"> <div class="et_pb_text et_pb_module et_pb_bg_layout_light et_pb_text_align_left"> <p><br /><?php the_excerpt(); ?><p> <p><?php the_category(); ?></p> <p><?php the_tags(); ?></p> <p><small><?php the_date(); ?></small></p> </div> </div> </div> </div> <hr /> <?php } ?> <div class="et_pb_text et_pb_module et_pb_bg_layout_light et_pb_text_align_center"> Seite <?php echo $query->query['paged']; ?> von <?php echo $query->max_num_pages; ?><br /> <div class="pagination"> <div class="nav-previous"><?php next_posts_link( 'Seite zurück', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Seite vor' ); ?></div> <?php /* example code for using the wp_pagenavi plugin */ if (function_exists('wp_pagenavi')) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> </div> <?php } else { echo "No Results Found"; } ?>
August 10, 2016 at 12:44 pm #54097In reply to: results.php as a grid
TrevorParticipantThis was the results.php modified to work with the Newspaper 7 theme (by TagDiv):
<?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() ) { ?> Es wurden <?php echo $query->found_posts; ?> Wetsuits gefunden<br /> Seite <?php echo $query->query['paged']; ?> von <?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 $td_count = 0; while ($query->have_posts()) { $query->the_post(); if ( $td_count == 0 ) { ?> <div class="td-block-row"> <?php } ?> <div class="td-block-span6"> <div class="td_module_1 td_module_wrap td-animation-stack"> <?php if ( has_post_thumbnail() ) { ?> <div class="td-module-image"> <div class="td-module-thumb"> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail("thumb");?> </a> </div> </div> <?php } ?> <h3 class="entry-title td-module-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> </div> </div> <?php $td_count = $td_count + 1; if ( $td_count > 1 ) $td_count = 0; if ( $td_count == 0 ) { ?> </div> <?php } } if ( $td_count == 1 ) { ?> hello</div> <?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"; } ?>
July 20, 2016 at 5:38 pm #51738In reply to: Shortcode results: don't display results until click
TrevorParticipantHi
I found two errors (one was ours, one yours), so here is the fixed code (I do not know if this will work):
<?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() ) { global $searchandfilter; $sf_current_query = $searchandfilter->get(44)->current_query(); if ($sf_current_query->is_filtered()) { ?> <?php echo $query->found_posts; ?> Firm(s) Meet All Selected Criteria<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> <h6><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h6> <p><?php the_tags(); ?></p> </div> <hr/> <?php } ?> <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 firms meet all of your criteria. Try unchecking some boxes."; } } ?>
May 20, 2016 at 3:13 pm #46150In reply to: Filter on Thrive Theme Builder post grid
TrevorParticipantGot the files. I will post the results.php here for others to use if they wish, with their copy of Ignition and Thrive Visual Builder:
<?php /** * Search & Filter Pro * * Sample Thrive Results Template * * @package Search_Filter * @author Trevor Nelmes * @link http://www.designsandcode.com/ * @copyright 2016 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; ?> Cars<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( 'Previous Page of Cars', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Next Page of Cars' ); ?></div> <?php /* example code for using the wp_pagenavi plugin */ if (function_exists('wp_pagenavi')) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> <div class="thrv_wrapper thrv_post_grid" data-unit="px"> <div class="tve_post_grid_wrapper tve_clearfix tve_post_grid_grid"> <div style="display: flex; flex-wrap: wrap;" class="tve_pg_row tve_clearfix"> <?php $thrive_counter = 0; $thrive_row_counter = 0; while ($query->have_posts()) { if ( $thrive_counter == 0 ) && ( $thrive_row_counter > 0 ) { ?> </div> <div style="display: flex; flex-wrap: wrap;" class="tve_pg_row tve_clearfix"> <?php } $query->the_post(); ?> <div class="tve_post tve_post_width_5 " style="align-items: stretch;"> <div class="tve_pg_container"> <?php if ( has_post_thumbnail() ) { $thrive_image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'single-post-thumbnail' ); ?> <a href="<?php the_permalink(); ?>"> <div class="tve_post_grid_image_wrapper" style="background-image: url('<?php echo $thrive_image[0]; ?>')"> <div class="tve_pg_img_overlay"> <span class="thrv-icon thrv-icon-forward"></span> </div> </div> </a> <?php } ?> <span class="tve-post-grid-title " style="font-size: 18px;line-height: 20px;font-family:'Arial', 'Helvetica', 'sans-serif';"> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </span> <div class="tve_pg_more" data-tve-custom-colour="62938813"> <a href="<?php the_permalink(); ?>">View Now</a> <span class="thrv-icon thrv-icon-uniE602"></span> </div> </div> </div> <?php $thrive_counter++; if ( $thrive_counter > 4 ) { $thrive_counter = 0; $thrive_row_counter++; } } ?> </div> </div> </div> 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( 'Previous Page of Cars', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Next Page of Cars' ); ?></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"; } ?>
Note that this search was for Cars for Sale, so some text strings have been modified to suit (like in the number of results and pagination).
-
AuthorSearch Results