我正在與WordPress Conditional Tags合作,並希望有不同的東西不常見。目前,我正在使用index.php
下面的代碼WordPress Template,這個代碼覆蓋了我在下面分享的66%的願望。分頁頁面的WordPress的條件標籤?
<?php if(is_home() && !is_paged()):?>
<!-- Different Data Will Be Shown On First Page Only Like www.example.com -->
<?php else: ?>
<!-- Different Data Will Be Shown On All Pages Except First Only Like www.example.com/page/2/, www.example.com/page/3/, www.example.com/page/4/, www.example.com/page/5/ .... -->
<?php endif; ?>
但我想顯示在主頁上和不同的數據也www.example.com/page/2/
如下一些信息
<?php if(is_home() && !is_paged()):?>
<!-- Different Data Will Be Shown On First Page Only Like www.example.com -->
<?php elseif(conditional goes here) ?>
<!-- Different Data Will Be Shown On Second Page Only Like www.example.com/page/2/ -->
<?php else: ?>
<!-- Different Data Will Be Shown On All Pages Except First And Second Only Like www.example.com/page/3/, www.example.com/page/4/, www.example.com/page/5/ .... -->
<?php endif; ?>
所以這是可能的,如果是,則什麼樣的代碼應該是使用而不是conditional goes here
?
我不明白你的問題:S你想要相同的數據出現在主頁和第二頁上嗎? – 2014-09-01 16:37:34
@dingo_d編輯的問題:我想要在問題中提到的各處使用不同的數據。我想在第一頁,第二頁和所有其他頁面上使用不同的數據... – 2014-09-03 04:23:14