Forums Forums Search & Filter Pro tags added to search results

Viewing 10 posts - 1 through 10 (of 10 total)
  • Anonymous
    #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
    #23486

    Are 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

    Anonymous
    #23487

    Yes, displaying with the shortcode.

    Thanks – I look forward to the next update,
    thanks

    Tim

    Ross Moderator
    #25750

    This 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
    #27302

    Hi,

    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
    #27456

    Hi Tim

    CAn you paste your code somewhere more readable like pastebin?

    Thanks

    Anonymous
    #27457

    Sure, here we go

    http://pastebin.com/3aAfhLXw

    Ross Moderator
    #27460

    I 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
    #27464

    Thanks.

    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
    #27465

    I can see that your <p> tags around the image are not properly opened and closed

    You 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?

Viewing 10 posts - 1 through 10 (of 10 total)