Pagination Problem in Arras Theme (5 posts)

  1. tnoguchi
    Posted 5 years ago #

    I'm working on a site for a client using a modified CMS'ified' Arras Theme--though I'm a bit of a WordPress/php newbie (and total hack).

    I created a posts template where the user can select a specific post from a specific project category (e.g. Conservation). Underneath the selected post is a archive listing of other projects in the same category, excluding the project shown.

    While I'm able to show the category specified, the pagination doesn't work. So if there are a total of 10 projects, and 5 are set to be shown when I select the 2nd page, the same projects appear in the listing.

    I looked up various solutions on the support forums using the following code to modify the 'query_post':

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

    However, in my case, I haven't been able to get it to work.

    I would appreciate any help on this. You can see the code here:


    Thank You,


  2. Michael
    Part-Time Forum Moderator
    Posted 5 years ago #

    is the reset there for a reason?
    line 157: <?php wp_reset_query(); ?>

    you might also want to look into $query_string:

  3. Shane G.
    Posted 5 years ago #

  4. tnoguchi
    Posted 5 years ago #

    @ alchymyth

    Thank you for the tips. I did look at the link for the $query_string that you provided, but am not sure that it applies in my case.

    Basically in lines 30-34, 9-106, I've defined the variables for my query post for the archive listing which runs below the post defined by the main loop. In my case, I'm not drawing my parameters from the URL. Perhaps this is the reason why I'm having problems with pagination?


    I appreciate the links, but don't think that it applies to my problem; though will come in handy for another project.

  5. tnoguchi
    Posted 5 years ago #

    So I did a bit more research on this problem online, and feel like I'm getting closer to the solution, but still can't get the pagination to work.



    This time I created a new $wp_query:

    $pargs = array(
    	'post__not_in' => array($post_ID),
    	'category_name' => $category_title,
    	'showposts' => '5',
    	'paged' => $paged,
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();

    and applied it directly to the code from the arras-theme:

    `<ul class="hfeed posts-quick clearfix">
    <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    <li <?php arras_post_class() ?>>

    <?php arras_projectheader($page_type) ?>
    <div class="entry-summary"><?php echo arras_strip_content(get_the_excerpt(), 20); ?></div>
    <?php arras_newsfooter($page_type) ?>

    <?php endwhile; ?>

    then some $wp_query variable swapping for the WP-PageNavi plugin:

      if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
      $wp_query = null; $wp_query = $temp; ?>

    But still no dice. I know this is an oft-repeated topic, but I'm still unable to make this work. Is there anyone who can look at my code and suggest a solution?


    Thank You!

Topic Closed

This topic has been closed to new replies.

About this Topic