-
10-0204
-
wordpress网站添加推荐文章有很多插件可以实现,下面介绍的是一个不用插件的实现方法。
操作步骤如下:
1、在管理后台添加一个“推荐”分类,将需要推荐的文章都添加到这个类目,最终通过调用这个”推荐”分类来显示推荐文章
2、调用方法:在sidebar.php或你要显示的页面相关位置处添加下面代码
Tags: wordpress, 推荐文章, 插件, 方法<?php query_posts(‘category_name=”推荐”&showposts=10′); ?>
<?php while (have_posts()) : the_post(); ?>
<ul><li><a href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a> </li></ul>
<?php endwhile;?>
相关日志
发表评论






- 评论 (0)
- 引用通告 (0)
发表评论 发起引用