WordPress.org

Ready to get started?Download WordPress

Forums

WP Page Navi on Search.php Page (1 post)

  1. cssbros
    Member
    Posted 1 year ago #

    Hello Guys!

    I've been troubleshooting for days now and I can't seem find the problem on getting the WP PageNavi work on my search.php results page.

    Here's the code for my search.php

    <?php if ( have_posts() ) : ?>
    <?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("showposts=1&paged=$page");?>

    <?php while ( have_posts() ) : the_post() ?>
    <div class="post">
    <div class="image-container">"> <img src="<?php the_field('thumbnail_image'); ?>" alt=""> </div>
    <!--image container-->
    <div class="article">
    <h2>">
    <?php the_title(); ?>
    </h2>
    <p>
    <?php the_field('excerpt'); ?>
    </p>
    " class="readmore">Read More > </div>
    <!--article-->
    <div class="article-2"> <span class="price">
    <?php the_field('price'); ?>
    </span>
    <div class="stars"> <img src="<?php the_field('rating_image'); ?>" alt=""> </div>
    <!--stars-->
    <div class="company"> "><img src="<?php the_field('company_icon'); ?>" alt=""> </div>
    <!--company-->

    </div>
    <!--article 2-->
    <div class="clear"></div>
    </div>
    <!--post-->

    <?php endwhile; ?>
    <?php wp_pagenavi(); ?>

    [please remember to mark any posted code properly - http://codex.wordpress.org/Forum_Welcome#Posting_Code ]

    I tried every solution but I really can't the page 2,page 3 and so on, to show up.

    It keeps showing 404 error page.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic