funbsd
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: the_content and next_posts_link did not work with query_postsI’m not familiar with php. Now I foud create a WP_Query works well too.
<?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query("category_name=life&paged=$paged"); ?> <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li> <?php endwhile; ?> <?php $wp_query = null; $wp_query = $temp;?>Forum: Fixing WordPress
In reply to: the_content and next_posts_link did not work with query_postsGreat! I’m looking for this solution for many days.
WordPress codex said:
The query_posts function is intended to be used to modify the main page Loop only.
It is not intended as a means to create secondary Loops on the page.
If you want to create separate Loops outside of the main one, you should create separate WP_Query objects and use those instead.In main page, I can use this:
query_posts("$query_string . "category_name=life&paged=$paged");
but it doesn’t work in my custom Template page.Now I use this:
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?> <?php query_posts("category_name=life&paged=$paged"); ?>It works well in my custom template page.
Forum: Fixing WordPress
In reply to: Admin cannot see private pagesI want private page showed in navimenu when I login,not only in Manage->Pages,how?
Forum: Fixing WordPress
In reply to: Admin cannot see private pages2.6.2,the same,can anyone help?