Forums › Forums › Search & Filter Pro › Open result links in same window
- This topic has 12 replies, 2 voices, and was last updated 6 years, 2 months ago by Anonymous.
-
Anonymous(Private) September 10, 2018 at 10:09 pm #187954
Can I change the settings so when a result is clicked, it opens in the same window instead of a new tab?
<?php /** * Search & Filter Pro * * Sample Results Template * * @package Search_Filter * @author Ross Morsali * @link https://searchandfilter.com * @copyright 2018 Search & Filter * * 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="results-found"> Found <?php echo $query->found_posts; ?> Results<br /></div> <div class='search-filter-results-list'> <?php while ($query->have_posts()) { $query->the_post(); ?> <div class='search-filter-result-item'> <?php if ( has_post_thumbnail() ) { echo '<p>'; the_post_thumbnail("small"); echo '</p>'; } ?> <h2><a>",><?php the_title(); ?></a></h2> </div> <?php } ?> </div> <?php } else { ?> <div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'> <span>End of Results</span> </div> <?php } ?>
Trevor(Private) September 11, 2018 at 9:23 am #187961You have a page of results and when you click to one of them you want it to open in the same window/tab?
Are you able to send me a live link/URL to your search page so I can take a look?
Having said that, opening in new or current window/tab behavior tends these days to be a browser setting made by the user, and not set by the page HTML.
Anonymous(Private) September 11, 2018 at 6:55 pm #188108Hi Trevor. Yes when a user clicks one of the results, I’d like it to open in the same tab instead of opening a new one. Here is the live page https://miamicirclemarble.com/browse-colors/?_sfm_stock=New%20Arrival. Thanks for the information on the browser settings. If there’s anything I can do to try to make it default to the same window, though, I’d appreciate it.
Thanks!Trevor(Private) September 12, 2018 at 2:17 pm #188222Ah, it wasn’t inside code backticks, so our forum software has mangled it. I tried to recover it, but it is still incomplete.
On my keyboard the back tick is on the key to the left of the 1 key. It needs one before all the code, and then one after.
Anonymous(Private) September 13, 2018 at 2:36 pm #188335<?php /** * Search & Filter Pro * * Sample Results Template * * @package Search_Filter * @author Ross Morsali * @link https://searchandfilter.com * @copyright 2018 Search & Filter * * 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="results-found"> Found <?php echo $query->found_posts; ?> Results<br /></div> <div class='search-filter-results-list'> <?php while ($query->have_posts()) { $query->the_post(); ?> <div class='search-filter-result-item'> <?php if ( has_post_thumbnail() ) { echo '<p>'; the_post_thumbnail("small"); echo '</p>'; } ?> <h2><a href="<?php the_permalink(); ?>",><?php the_title(); ?></a></h2> </div> <?php } ?> </div> <?php } else { ?> <div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'> <span>End of Results</span> </div> <?php } ?>
-
AuthorPosts