• Resolved Warry86

    (@warry86)


    Hi,1. I have put a search on my wordpress, but it seems to display only 1 result everytime and I don’t know why

    <h1><?php printf( __( 'Search Results for: %s' ), '' . get_search_query() . '' ); ?></h1>
    <?php if ( have_posts() ) : ?>
      <?php while (have_posts()) : the_post(); ?>
       <a href="<?php the_permalink() ?>" rel="bookmark"><div class="boxy">
     <img src="<?php video_thumbnail(); ?>" width="378px" height="220px;"   />
    
          <h3><?php echo get_the_title(); ?> </h3>
    <h5 class="artistindex"><?php
      $posttags = get_the_tags();
      if ($posttags) {
        foreach($posttags as $tag) {
          echo $tag->name . ' ';
        }
      }
    ?></h5>
    
      </div> </a>
      <?php endwhile; ?>
    <?php else: ?>
      <h2>Nothing Found</h2>
      <p>
        Sorry, but nothing matched your search criteria. Please try again with some different keywords.
      </p>
    <?php endif; ?>
    
    <?php if ( $wp_query->max_num_pages > 5 ) : ?>
      <div class="prev">
        <?php previous_posts_link( __( 'Prev' ) ); ?>
      </div>
      <div class="next">
        <?php next_posts_link( __( 'Next' ) ); ?>
      </div>
    <?php endif; ?>

    https://guillaume-loreau.fr/project/?s=swoon

    Thanks a lot for your time.

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Search displays only 1 result.’ is closed to new replies.