Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro The Loop seems to only display one search item.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Brookstone Creative
    #204664

    Hello
    I am using the loop to display my post types but it seems to only ever display 1. Is this markup incorrect?

    <?php 
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    <div class="pindex">
        <div class="pimage">
            <a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail() ) {the_post_thumbnail();} ?></a>
        </div>
    
    <tbody>
    <table>
    <tr>
    <td class="ptitle">
        <a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a>
    </td>
    <td>
        <img src="<?php the_field('language'); ?>" />
    </td>
    <td>
        <?php the_field('publish_date'); ?>
    </td>
    <td>
        <a href="<?php the_field('download'); ?>" target="_blank">Download</a>
    </td>
    </tr>
    </table>
    </tbody>
    
    </div>
    
    <?php endwhile; else : ?>
    <p><?php esc_html_e( 'Sorry, no posts matched your criteria.' ); ?></p>
    <?php endif; ?>
    Trevor Moderator
    #204667
    This reply has been marked as private.
    Brookstone Creative
    #204681
    This reply has been marked as private.
    Trevor Moderator
    #204693
    This reply has been marked as private.
    Brookstone Creative
    #204701

    Hello,
    The Display Results tabs warns you that you need to use The Loop and not a custom query.

    I copied this line from link that was provided for this
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    I am not sure if I need this. I have tried removing it but it breaks the page.

    Thanks

    Trevor Moderator
    #204705
    This reply has been marked as private.
    Brookstone Creative
    #204713

    Thankyou I didn’t realise there was another the_post();
    Yes that as worked great thanks.

    One more question I noticed on your demo when you select a different filter only the content refreshes. However on mine the whole page refreshes how do I do this?
    https://demo.designsandcode.com/sfpro-movie-reviews/

    Trevor Moderator
    #204718

    Try changing the ajax Container from #main to .post-content

    Brookstone Creative
    #204748

    Thanks that as worked great 🙂

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

The topic ‘The Loop seems to only display one search item.’ is closed to new replies.