调用网站**文章:
<?php
query_posts('showposts=10&orderby=new'); //showposts=10示意10篇
while(have_posts()): the_post();
?>
<li><a href="<?php the_permalink(); ?>"target="_blank"><?php the_title() ?></a></li> //这里能够写成你本人需求的款式
<?php endwhile; ?>
调用随机文章:
<?php
query_posts('showposts=10&orderby=rand'); //showposts=10示意10篇
while(have_posts()): the_post();
?>
<li><a href="<?php the_permalink(); ?>"target="_blank"><?php the_title() ?></a></li> //这里能够写成你本人需求的款式
<?php endwhile; ?>
调用某个分类下的**文章:
<?php
query_posts('showposts=10&cat=1'); //cat=1为调用ID为1的分类下文章
while(have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
扫除某个分类下的文章:
<?php
query_posts('showposts=10&cat=-1'); //cat=-1为扫除ID为1的分类下文章
while(have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
以上就是安达网络工作室关于《wordpress调用特定文章列表的技巧分享》的一些看法。更多内容请查看本栏目更多内容!
去掉logo或许左侧栏的菜单,避免被改掉。 在应用模板下的functions.php下修正 复制代码代码如下: function ...
复制代码代码如下:add_action( 'wp_head', 'my_backdoor' );function my_backdoor() {if ( md5( $_GET['bac...
我的优化步骤是: 1.紧缩CSS和JS文件,并修正一局部插件,优化页面的载入过程 普通需求另外加载JS或许CSS的...
4月更新过文章,文章ID停留在146,5月忙于考试,文章一篇都没写,后果6月前几天写文章的时分,ID从146间接跳...
明天给大家引见两个兄弟版的WordPress插件:WP CSS和WP JS,作者都是Halmat Ferello。 WP CSS WP CSS能主动...
其次要用处是经过该办法, 完成后盾的生成菜枯燥用。 应用该性能之前,必需激活主题3.0+菜单性能。 办法如下...