• Resolved Neysa

    (@neysa)


    Hi All,

    This is the last to-do before I can finally get this site running, and I’ve had two people trying to figure this out all day. The pagination only refreshes to the first page, no matter which page you click on. Here is a link to my site.

    I will happily post some code and give more information but I’m not even sure where the problem area is. Can anyone give me a good direction to go? Thanks so much.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Looks like your theme’s index.php template file contains an improperly defined custom query.
    https://codex.www.ads-software.com/Function_Reference/query_posts

    Thread Starter Neysa

    (@neysa)

    esmi, first I just want you to know how incredibly helpful you’ve been to me on numerous issues as I perused around WP Support and saw your answers. Really, thanks for being so direct and helpful.

    Okay, I thought it might have something to do with this, but I’m at a loss to fix it. I’m pretty new with queries. Can you give me an idea of what’s wrong here?

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Can you just post the few lines around query_posts (assuming it’s in there)?

    Thread Starter Neysa

    (@neysa)

    These are the only lines that mention query.

    <?php $wp_query = new WP_Query(array('cat'=>of_get_option('category_slider'),'showposts'=>of_get_option('postnumber_slider'))); ?>
                        <?php if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); ?>

    Thanks.

    Try replacing:

    <?php $wp_query = new WP_Query(array('cat'=>of_get_option('category_slider'), 'showposts'=>of_get_option('postnumber_slider'))); ?>

    with:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args = array(
    	'cat' => of_get_option('category_slider'),
    	'showposts' => of_get_option('postnumber_slider'),
    	'paged' => $paged
    );
    $wp_query = new WP_Query($args); ?>
    Thread Starter Neysa

    (@neysa)

    Hi esmi,

    That did fix the pagination problem. However the slider now appears on every page and pulls the images from whatever page it’s on. I will try to figure out how to anchor it on the first page only. Any thoughts appreciated. Thank you again for your help.

    That sounds like a theme issue. As this is a commercial theme whose template files are not freely available, we cannot help. You need to seek support from the theme’s vendors.
    https://www.organicthemes.com/support

    Thread Starter Neysa

    (@neysa)

    Yes, I appreciate it. Thanks so much.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Pagination resolves only to 1st page’ is closed to new replies.