0
我有類似這樣的代碼:the_post()衝突在WordPress腳本
while (have_posts()) : the_post();
.... more code ...
$my_query = new WP_Query($args);
if ($my_query->have_posts()) :
while ($my_query->have_posts()) :
$my_query->the_post();
.... other code ..
的問題是如何避免the_post()
衝突? 因爲有了第一個while loop
我正在訪問一些posts
和其他帖子。而我的網站從第二時間顯示信息,但它應該首先顯示帖子的信息。現在我認爲這是令人困惑的帖子...
while循環,反正不要在inner while循環中使用the_post()。 –