• i have a page template that query posts from a category and display it..
    Ive installed a wp-pagenavi plugin to paginate the queried category posts.. but it wont work also i have a previous_posts_link() in case but still wont work.. upon clicking the link the posts dont change..
    here is the code i use.. please help me im just a noob in wordpress php programmin… i just copy this php codes from the web and hope someone can help me on this.. thank you very much in advance…

    <?php
    /*
    Template Name: PageOfPosts
    Modified for iNove Theme in WP 2.8 by Robert Savage.
    */
    wp_enqueue_script( ‘jquery’ );
    get_header();

    $options = get_option(‘inove_options’);
    if (function_exists(‘wp_list_comments’))
    {
    add_filter(‘get_comments_number’, ‘comment_count’, 0);
    }

    // if this is a certain page ID, then set the category to a specific category id.
    if (is_page(’19’) )
    {
    $cat = array(4);
    }

    else
    {
    $cat = ”;
    }

    $showposts = 3; // -1 shows all posts
    $do_not_show_stickies = 1; // 0 to show stickies
    $args=array(
    ‘category__in’ => $cat,
    ‘showposts’ => $showposts,
    ‘caller_get_posts’ => $do_not_show_stickies,

    );
    $my_query = new WP_Query($args);

    ?>

    <?php
    //get_sidebar();
    ?>
    <script type=”text/javascript”>

    jQuery(document).ready(function($) {
    // $() will work as an alias for jQuery() inside of this function

    $(‘.intro’).click(function() {

    $(this).animate({
    height : ‘toggle’,
    opacity: ‘toggle’
    }, 500)
    .parent(‘.content’).children(‘.whole’).animate({
    height : ‘toggle’,
    opacity: ‘toggle’

    }, 500);

    });
    $(‘.whole’).click(function() {

    $(this).parent(‘.content’).children(‘.whole’).animate({
    height : ‘toggle’,
    opacity: ‘toggle’

    }, 500)

    .parent(‘.content’).children(‘.intro’).animate({
    height : ‘toggle’,
    opacity: ‘toggle’
    }, 500);

    });

    });

    </script>

    <div id=”primary” class=”hfeed” style=”width: 720px;”>
    <?php if( $my_query->have_posts() ) : ?>

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

    //necessary to show the tags
    global $wp_query;
    $wp_query->in_the_loop = true;
    ?>

    <div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>

    <div class=”post-thumbnail-div”>
    <?php the_post_thumbnail(‘post-thumbnails’); ?>
    </div>

    <div class=”post-entry-div” style=”width: 600px;”>

    <h3>
    <!– THE TITLE –>
    ” rel=”bookmark”><?php the_title(); ?>
    </h3>

    <div class=”info”>
    <span class=”date”><?php the_time(__(‘F jS, Y’, ‘inove’)) ?></span>
    <?php if ($options[‘author’]) : ?><span class=”author”><?php the_author_posts_link(); ?></span><?php endif; ?>
    <?php edit_post_link(__(‘Edit’, ‘inove’), ‘<span class=”editpost”>’, ‘</span>’); ?>
    <span class=”comments”><?php comments_popup_link(__(‘No comments’, ‘inove’), __(‘1 comment’, ‘inove’), __(‘% comments’, ‘inove’), ”, __(‘Comments off’, ‘inove’)); ?></span>
    <div class=”fixed”></div>
    </div>

    <div class=”content”>

    <?php //the_content(__(‘CONTINUE READING->’, ‘inove’)); ?>
    <div class=”intro”><?php echo content(’50’); ?></div>
    <div class=”whole”><?php the_content(); ?></div>

    >Read More

    <div class=”fixed”></div>
    </div>

    <div class=”under”>
    <span class=”date”>Posted at <?php the_time(‘F j, Y’); ?> at <?php the_time(‘g:i a’); ?> </span>
    <span class=”comments”><?php comments_popup_link(__(‘No comments’, ‘inove’), __(‘1 comment’, ‘inove’), __(‘% comments’, ‘inove’), ”, __(‘Comments off’, ‘inove’)); ?></span>
    <div class=”fixed”></div>
    </div>

    </div>

    </div>

    <?php endwhile; ?>

    <div id=”pagenavi”>
    <?php
    kriesi_pagination(6,6);

    ?>
    <div class=”fixed”></div>
    </div>

    <?php else : ?>

    <div class=”errorbox”>
    <?php _e(‘Sorry, no posts matched your criteria.’, ‘inove’); ?>
    </div>

    <?php endif; ?>

    </div>

    <?php get_footer(); ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Pagination wont work’ is closed to new replies.