• Resolved crisp82

    (@crisp82)


    Hi,

    I am currently using TheMorningAfter theme by WooThemes, and am trying to add pagination to the featured posts section. I have tried adding it using SEO Pager, and while this added the page numbers at the bottom, they only refresh the page. I have seen people saying that this does not work in WordPress 3.0.

    Here is my current query:

    <?php
    					$feat_id = get_cat_id($woo_options['woo_featured_category']);
    					$limit = $woo_options['woo_featured_limit'];
    
    $the_query = new WP_Query("cat=$feat_id&showposts=$limit");
    
    					while ($the_query->have_posts()) : $the_query->the_post();
    
    					$do_not_duplicate = $post->ID; ?>

    Is there anyway to change this to allow pagination?

    Thanks,

    crisp82

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter crisp82

    (@crisp82)

    *bump

    Thread Starter crisp82

    (@crisp82)

    Anyone?!

    Thread Starter crisp82

    (@crisp82)

    I resolved this using:

    <?php
    while (have_posts()) : the_post();

    $do_not_duplicate = $post->ID; ?>

    and using SEO Pager

    php.mastermind

    (@phpmastermind)

    to display posts category wise you just need to add this code. or to extend the filtration u just need to add additional parameters in $args array.

    <?php
    // make query fileration
    $args = array(
    ‘posts_per_page’ => 20,
    ‘paged’ => $paged,
    ‘cat’ => $cat_id,
    );
    $wp_query = new WP_Query($args);

    $i = 0;
    if ( $wp_query->have_posts() ) while ($wp_query->have_posts()) : $wp_query->the_post();

    $pop_img = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID) );
    ?>
    <li style=” <?php echo ($i%4==0)?”clear:both;”:””; ?> “> ” class=”img”><img src=”<?php echo $pop_img[0]; ?>” alt=”” />
    <h5>“><?php echo substr(get_the_title($post->ID),0,20); ?></h5>

    <?php
    $i++;
    endwhile;
    ?>

    <?php
    // for pagination just need to call this function and it will create complete pagination

    theme_pagination($wp_query->max_num_pages); ?>

    get the theme_pagination function code from here http://www.php-mastermind.com and put in your theme functions.php file. it should work now.
    Note*- do it on your own risk.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Custom Query and Pagination’ is closed to new replies.