Forums › Forums › Search & Filter Pro › tags added to search results
- This topic has 9 replies, 2 voices, and was last updated 9 years, 1 month ago by Ross.
-
Anonymous(Private) August 17, 2015 at 4:48 pm #23346
Hi,
I’m having a problem with the search results that I just can’t work out.
I’ve added our own search results template, and have applied a ‘clear: left’ css command to every even DIV, so that they always appear in columns of two.
However, tags are getting added, and I can’t see from where. It seems to be throwing the ordering out of kilter.
Page is here:
http://mytheatremates.com/news-reviews-and-features/Ross Moderator(Private) August 20, 2015 at 3:33 pm #23486Are you displaying results with shortcode?
There is a bug in the sample results template – you will that there are some
<p>
tags that are not closed properly</p>
.. this is fixed in the next update.Thanks
Ross Moderator(Private) September 24, 2015 at 5:33 pm #25750This is resolved in the latest update – be sure to read the upgrade notes here before updating:
http://www.designsandcode.com/documentation/search-filter-pro/getting-started/
Thanks
Anonymous(Private) October 14, 2015 at 1:12 pm #27302Hi,
I’ve downloaded and installed the latest update, and everything seems to work, but the problem I previously had persists.
To clarify, it’s not the <p> tag which is causing a problem, but rather an extra tag which seems to creep in amongst occasional posts, and through the ordering out.
Here’s the page it’s happening on:
http://mytheatremates.com/news-reviews-and-features/?sf_paged=2(although site is constantly updated, so may need to scroll to older posts to see the problem).
You’ll see that every ‘even’ div is set to clear: left. But then an extra tag surrounds the 10th or div or later, and doesn’t get closed, which means that the next div is the first in that section, and therefore the numbering is reset – and clear: left doesn’t apply in order anymore.
Here’s the code of the edited template file we’ve created. We’ve not used tags anywhere, so I can’t see where they’re creeping in.
Can you advise?
thanks
Tim
TEMPLATE:
<?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=”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 class=”search-posts-result <?php the_author(); ?>”>
” target=”_blank” class=”search-results-image”>
<?php
if ( has_post_thumbnail() ) {
echo ‘<p>’;
the_post_thumbnail(“small”);
echo ‘</p>’;
}
?>
<h2>” target=”_blank”><?php the_title(); ?></h2><div class=”search-posts-date”><?php the_date(); ?></div>
<div class=”search-posts-content”><?php content(’30’); ?> ” target=”_blank”><span class=”read-more-link”>Read more…</span></div><div class=”search-posts-author”>from <?php the_author(); ?></div>
</div>
<?php
}
?><?php
}
else
{
echo “No Results Found”;
}
?>Ross Moderator(Private) October 15, 2015 at 6:25 pm #27456Hi Tim
CAn you paste your code somewhere more readable like pastebin?
Thanks
Ross Moderator(Private) October 15, 2015 at 6:51 pm #27460I see an error here:
echo '<p>'; the_post_thumbnail("small"); echo '</a></p>';
The anchor tag is not closed, but just checking the S&F template I can see this error is not there:
if ( has_post_thumbnail() ) { echo '<p>'; the_post_thumbnail("small"); echo '</p>'; }
Thanks
Anonymous(Private) October 15, 2015 at 7:19 pm #27464Thanks.
I’ve corrected that double closing
</a>
, but the problem persists.Here’s the corrected code:
http://pastebin.com/LCpUxVJd(You’ll see the
<a></a>
just surrounds the image)The problem, which you can see on this page:
http://mytheatremates.com/news-reviews-and-features/?sf_paged=3
(Weekly Theatre Podcast post)is the erroneous tag that opens and is never closed.
thanks
Tim
Ross Moderator(Private) October 15, 2015 at 7:36 pm #27465I can see that your
<p>
tags around the image are not properly opened and closedYou open the
<p>
inside the<a>
but the close it outside the</a>
This is not really a S&F issue anymore, if you default to the supplied
results.php
in the S&F template folder (of the plugin) do you see any out of place<p>
tags? -
AuthorPosts