Php “你怎么看?”;如果贴子页面大于第1页,则显示“代码”;在wordpress上?
我把我的博客文章分解成分页符,我只希望广告出现在每一页上,除了第1页。我见过有人这么做,我就是找不到Php “你怎么看?”;如果贴子页面大于第1页,则显示“代码”;在wordpress上?,php,wordpress,Php,Wordpress,我把我的博客文章分解成分页符,我只希望广告出现在每一页上,除了第1页。我见过有人这么做,我就是找不到 if(page > 1) { <p>Show this this line of code here</p> } if(第1页){ 在这里显示这行代码 } 我记得它看起来是这样的多页博客文章的页码存储在全局变量$page中。检索该变量以在代码中使用 例如: global $page; if ( $page > 1 ) { // output
if(page > 1) {
<p>Show this this line of code here</p>
}
if(第1页){
在这里显示这行代码
}
我记得它看起来是这样的多页博客文章的页码存储在全局变量
$page
中。检索该变量以在代码中使用
例如:
global $page;
if ( $page > 1 ) {
// output here.
}
我很确定这应该可以
$paged = get_query_var( 'paged', $default )
If( $paged > 1 ) {
echo '<p>Show this line of code</p>';
}
$paged=get\u query\u var('paged',$default)
如果($paged>1){
回显“显示这行代码”;
}
我是通过“分解为分页符”得到这个想法的,他是说它是分页的?哈哈,我们中的一个人可能是对的:)@RickCalder这是一个很好的观点,OP可能指的是一个档案,而不是一篇文章。