[英]I want to count number of page breaks in my wordpress post
我的wordpress帖子的代碼將在我的single.php頁面中顯示以下已使用的數組。 我想檢查在wordpress帖子中放入的分頁符數量。 這樣,我想在wordpress管理員的apost中添加上一個和下一個按鈕鏈接。
<?php
$args = array(
'before' => '<div class="page-link-next-prev">',
'after' => '</div>',
'link_before' => '',
'link_after' => '',
'next_or_number' => 'next',
'nextpagelink' => __('<div class="next">Continue Reading</div>'),
'previouspagelink' => __('<div class="prev">Go Back</div>'),
'pagelink' => '%',
'more_file' => '');
wp_link_pages($args);
?>
與count($ pages)中一樣使用php count()函數。
我會將其存儲為變量,例如:$ num_of_pages = count($ pages);
然后,您可以根據需要使用它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.