比如说,我有一些帖子,其中一些很粘。粘性贴子显示在循环的最顶部。
while( have_posts() ) {
the_post();
get_template_part();
}
如何在所有粘贴帖子之后添加一些文本?比如说,我有一些帖子,其中一些很粘。粘性贴子显示在循环的最顶部。
while( have_posts() ) {
the_post();
get_template_part();
}
如何在所有粘贴帖子之后添加一些文本?好的,我知道了。
首先,在循环之前添加一个计数器。
$my_posts = 0;
$my_posts++;
if( $my_posts === count( get_option( \'sticky_posts\' ) ) )
echo \'this will only appear after all sticky posts\';
我有自定义帖子(实际上是页面),可以在默认页面(page home.php)上查看,但如何创建一个单独的页面,包含完全相同的内容,并链接到它?主页。php(默认WP页)代码当前为:<?php /* Template Name: Home News */ ?> <?php get_header(); ?> <div id=\"content\"> <div id=\"inner-cont