WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Pagination wont work for me :'( (1 post)

  1. santosh.sahoo
    Member
    Posted 3 years ago #

    i have tried many things but cant get it correct..plzzzz help...

    `
    function My_customsearch(){
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $post_per_page = 4; // -1 shows all posts
    $do_not_show_stickies = 1; // 0 to show stickies
    $args=array(
    'category__in' => array(1,2,3,4,5),
    'paged' => $paged,
    'orderby' => 'post_title',
    'order' => 'DESC',
    'posts_per_page' => $post_per_page,
    'caller_get_posts' => $do_not_show_stickies
    );
    $wp_query = new WP_Query($args); ?>

    <?php if(have_posts()) : ?>
    <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>

    <a>"><?php the_title(); ?></a>

    <?php echo excerpt(20); ?>
    <a>" > read more </a>
    <?php endwhile; ?>

    <?php previous_posts_link('« Prev |') ?>
    <?php next_posts_link('  Next »') ?>
    <?php wp_pagenavi(); ?>

    <?php endif; } ?>`

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags