日期:2015-01-03 阅读:4859
dmandwp系统 - wordpress系统和DM系统区块建站>>
插件:
https://wordpress.org/plugins/list-category-posts/
https://wordpress.org/plugins/w4-post-list/
---
list-category-posts
使用说明:https://wordpress.org/plugins/list-category-posts/other_notes/
使用不同的模板:
在插件的templates目录下有样本。
[catlist id=1 template=yourmb morelink="Read more" thumbnail=yes]
这个会去调当前主题下的list-category-posts这个目录(需要新建)的yourmb.php
-----
[catlist name=mycategory orderby=title order=asc]
[catlist search="The Cake is a lie"]
[catlist tags="videogames" exclude_tags="sega,sony"]
[catlist taxonomy='person' terms='bob']
[catlist post_type="page,post" numberposts=-1]
更多 :https://github.com/picandocodigo/List-Category-Posts/wiki/How-to-select-which-posts-to-show
------------
在小工具和模板文件如下:要用do_shortcode
<?php echo do_shortcode( '[catlist id=2 template=post-mb1 morelink="Read more" thumbnail=yes]' ) ?>
----------
模板文件:
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( 'thumbnail' ); ?>
<p><?php echo the_title();?></p>
</a>
=====================
如果在首页显示一个文章的内容,这样即可:
<?php
echo get_post($id)->post_content;
?>
-------------------------