Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter rkorebritscs

    (@rkorebritscs)

    sorry guys, i’ve been really stupid. I don’t have enough posts in this new install to show the paging ??

    * going to jump off a bridge

    Thread Starter rkorebritscs

    (@rkorebritscs)

    I already have that:

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

    Thread Starter rkorebritscs

    (@rkorebritscs)

    I’m back. I’ve just upgraded to WP3 and the paging doesn’t work anymore.

    I’ve tried it with WP Paging, WP Paginate and WP Pagenavi…

    The loop works fine and the posts are displayed correctly. but there is no navigation…

    $wp_query = null;
          $wp_query = new WP_Query();
          $wp_query->query("paged=$page&cat=".$this->category."&posts_per_page=".$this->postsPerPage);
    
          while ($wp_query->have_posts()):
                echo $wp_query->post->ID; //example
          endwhile;
            if(function_exists('wp_paging')){
    
              $args = array(
                'base' => add_query_arg( 'paged', '%#%' ),
                'total' => $wp_query->max_num_pages,
                'current' => $page
              );
              wp_paging();
            }
            else die("paging plug-in not installed!");
    Thread Starter rkorebritscs

    (@rkorebritscs)

    Thanks Kees,

    This works perfect!

    Thread Starter rkorebritscs

    (@rkorebritscs)

    Hi Guys,

    I still can’t get this working… This is what I have now:

    @kees:

    <?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
    <?php $my_query = new WP_Query("paged=$page&category=3&numberposts=4"); ?>
    <?php
    while($my_query->have_posts()){
      $my_query->the_post();
    
      echo the_title();
      echo the_content();
    }
    
    $args = array(
      'base' => add_query_arg( 'paged', '%#%' ),
      'total' => $my_query->max_num_pages,
      'current' => $page
    );
    
    if(function_exists('wp_paging'))
      echo wp_paging();
    else
      echo "does not exist!";
    
    ?>

    the_title() and the_content() show correctly, but there is no paging…

    @senthil:

    global $wp_query;
    $result = new WP_Query('cat=3');
    
    $args = array(
     'base' => add_query_arg( 'paged', '%#%' ),
     'total' => $result->max_num_pages,
     'current' => $page
      );
    
    if (have_posts()):
      while (have_posts()): 
    
        the_post();
    
        echo the_title();
        echo the_content();
    
      endwhile;
    endif;
    
    if(function_exists('wp_paging'))
      echo wp_paging();
    else
      echo "does not exist!";

    Not working at all…

    Thread Starter rkorebritscs

    (@rkorebritscs)

    ps.
    I have been looking at “The loop”, but I don’t really see how I use this in combination with getting posts from a category?

    Thread Starter rkorebritscs

    (@rkorebritscs)

    Thanks Senthil! Neat plug-in, but I haven’t got it working yet. I think this is due to the way i collect the data:

    $posts = get_posts('category=3');
    foreach($posts AS $v){
     //html
    }
    
    $args = array(/*stuff*/);
    
    if(function_exists('wp_paging'))
      echo wp_paging('show_all=true');
    else
      echo "function does not exist!";

    The plugin is installed correctly, do i need to do something with: “if (have_posts()) : while (have_posts()) : the_post();”??
    I’m still a bit of a WordPress n00b..

    Thanks again!

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