0
我試圖讓頁面顯示某個類別。這種特殊的網頁是「創意和想法」獲取這個category.php來顯示某個類別! (WordPress的)
我想寫寫我的意見和想法了幾行,並在其下,顯示與ID 16類別名爲「思考」
我將如何去?
這裏是我的主題category.php:
<?php get_header(); ?>
<div id="wrap">
<!-- Main Content-->
<img src="<?php bloginfo('template_directory');?>/images/content-top.gif" alt="content top" class="content-wrap" />
<div id="content">
<!-- Start Main Window -->
<div id="main">
<?php global $query_string; $catnum_posts = get_option('theme_catnum_posts') ;
query_posts($query_string . "&showposts=$catnum_posts&paged=$paged&cat=$cat"); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php include(TEMPLATEPATH . '/includes/entry.php'); ?>
<?php endwhile; ?>
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
else { ?>
<?php include(TEMPLATEPATH . '/includes/navigation.php'); ?>
<?php } ?>
<?php else : ?>
<?php include(TEMPLATEPATH . '/includes/no-results.php'); ?>
<?php endif; wp_reset_query(); ?>
</div>
<!-- End Main -->
<?php get_sidebar(); ?>
我試圖改變:
query_posts($query_string . "&showposts=$catnum_posts&paged=$paged&cat=$cat"); ?>
到
query_posts($query_string . "&showposts=$catnum_posts&paged=$paged&cat=16"); ?>
但是它沒有工作..
有何想法?
$ query_string解析爲什麼?另外,如果您在此之前有任何其他查詢,則需要在query_posts()之前執行wp_reset_query() –