rkorebritscs
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Pagination of posts in pagesorry 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
Forum: Fixing WordPress
In reply to: Pagination of posts in pageI already have that:
[Code moderated as per the Forum Rules. Please use the pastebin]
Forum: Fixing WordPress
In reply to: Pagination of posts in pageI’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!");
Forum: Fixing WordPress
In reply to: Pagination of posts in pageThanks Kees,
This works perfect!
Forum: Fixing WordPress
In reply to: Pagination of posts in pageHi Guys,
I still can’t get this working… This is what I have now:
<?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…
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…
Forum: Fixing WordPress
In reply to: Pagination of posts in pageps.
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?Forum: Fixing WordPress
In reply to: Pagination of posts in pageThanks 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!