Had a minor problem with this neat plugin and solved it. It is said that wp_pagenavi does not work with eg. WP_query(). This should be also noted with get_posts(), did not see anything from this plugin. When changed to query_posts() then navi plugin started to work again.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
This form works:
//if not exists assigns value 1
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
//query 5 posts
query_posts("posts_per_page=5&paged=$paged");