0
我將WordPress博客文章加載到我的網站上的靜態PHP頁面中。這裏只是相關的代碼部分。目前,只有3篇博客文章出現,但是我希望每點擊一下按鈕就能載入3篇博文。最後,當沒有更多的帖子加載時,在id = theend中顯示文本(我正在使用jquery)。謝謝。如何通過點擊按鈕來增加PHP變量中的整數?
<?php require($_SERVER['DOCUMENT_ROOT'] . '/blog/wp-load.php'); ?>
<?php
global $post;
$args = array('posts_per_page' => 3);
<div class="row">
// here is where the 3 posts (title, img, etc.) load
</div>
<?php endforeach; ?>
/////////////
<span id="theend" style="display:none">No more posts to display</span>
<button class="btn">Read More</button>