范例代码如下所示:
<?php
query_posts('showposts=1&cat=76&offset=2');
while(have_posts()): the_post();
?>
<div class="article">
<a href="<?php the_permalink();?>" class="entry-featured-image-url" title="点击查看【<?php the_title();?>】详情"></a>
<h2 class="entry-title"><a href="<?php the_permalink();?>" target="_blank" class="title" title="点击查看【<?php the_title();?>】详情">自定义标题内容</a></h2>
<div id="abstract"><p class="comment"><?php echo wp_trim_words( get_the_content(), 55 ); ?></p></div>
</div>
<div class="button"><a href="<?php the_permalink();?>" class="entry-featured-image-url">查看详情</a></div>
<?php endwhile;
?>
以上代码的意思是,调用分类ID为76下面的1篇文章,偏移取最新的文章的第2篇内容。
此代码适合特殊版块的内容的单独调用!!!此代码可反复重复使用,不过要切记更换最开始的三个调用的值.








![Mysql innodb 系统表损坏带来的问题[Warning] InnoDB: Cannot open table XXX/wp_downloads from the internal data dictionary of InnoDB though the .frm file for the table exists. 终极解决办法](https://nrcs.xyz/wp-content/themes/begin/prune.php?src=https://nrcs.xyz/wp-content/uploads/2023/09/e4165-2023-09-28_102533.png&w=280&h=210&a=&zc=1)




评论