所以我有一个所谓的“最新消息”,并使用自定义模板页面t_latest_news.php添加页面侧边栏
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="latest-news" id="post-<?php the_ID(); ?>"> <?php the_content(); ?> <?php edit_post_link('Edit this page','<p class="edit-link">','</p>'); ?> </div><!-- /.latest-news --> <?php endwhile; endif; ?>
我创建了一个页面项目,并把一些内容放到这个页面。现在,我想在侧边栏上显示内容。我该怎么做?
我已经试过类似:
<?php include(get_query_template('t_latest_news.php')); ?> <?php include(TEMPLATEPATH . 't_latest_news.php'); ?> <?php get_query_template('t_latest_news.php') ?> <?php get_template_part('t_latest_news.php'); ?>
但他们没有工作。帮帮我!
<?php query_posts('page_id=76'); ?> <?php while (have_posts()) { the_post(); ?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php } ?> <?php wp_reset_query(); ?>
它与 “PAGE_ID”,而不是页面名。任何想法?
我已经把这个,但似乎并没有工作。 <?php query_posts('pagename = t_latest_news'); ?> – solidcolour 2010-09-20 17:21:19