|

- 积分
- 19
- 金钱
- 7 WPB
|
地板
发表于 2007-11-9 04:11
| 只看该作者
基本上搞定了
在主题目录里面建立一个新的PHP文件,内容如下
- <?php
- /*
- Template Name: guid
- */
- ?>
- <?php get_header(); ?>
- <div id="content" class="widecolumn">
- <?php $posts = get_posts( "category=4&numberposts=10" ); ?>
- <?php if( $posts ) : ?>
- <ul><?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
- <li>
- <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
- </li>
- <?php endforeach; ?>
- </ul>
- <?php endif; ?>
- </div>
- <?php get_footer(); ?>
复制代码
这样就在页面模板里面新加入一个guid模板
WP后台写页面的时候选好要的页面模板就可以用了
顺便说下category=4是读取的分类ID,numberposts=10是读取的数目
Template Name: guid这里设置模板的名称
完美的完成一次自问自答案,真晕,希望对大家有帮助,很适用的功能,我这里只原理上实现,细节大家慢慢弄了 |
|