我看到一個非常類似的帖子這個和許多其他例子,如這裏自定義功能的WordPress的文檔: Function reference for next/prev post link修改博客頁面來自同一個類別只顯示帖子時按下下一個/上鍊接
然而,我的例子坐在內似乎是在店面(woothemes)主題範圍內的自定義功能等我有納入正確的方式「$ in_same_term = TRUE,」不破壞功能的麻煩。下面是代碼在我想我需要以某種方式納入「$ in_same_term =真」的主題中的「post.php中」文件(原料)有點...
if (! function_exists('storefront_paging_nav')) {
/**
* Display navigation to next/previous set of posts when applicable.
*/
function storefront_paging_nav() {
global $wp_query;
$args = array(
'type' => 'list',
'next_text' => _x('Next', 'Next post', 'storefront') . ' <span class="meta-nav">→</span>',
'prev_text' => '<span class="meta-nav">←</span> ' . _x('Previous', 'Previous post', 'storefront'),
);
the_posts_pagination($args);
}
if (! function_exists('storefront_post_nav')) {
/**
* Display navigation to next/previous post when applicable.
*/
function storefront_post_nav() {
$args = array(
'next_text' => '%title <span class="meta-nav">→</span>',
'prev_text' => '<span class="meta-nav">←</span> %title',
);
the_post_navigation($args);
}
}
我想我可能是接近的搜索負荷已經揭示了同一種信息的,我只是不正確集成起來......
預先感謝如何最好地將這個功能有什麼建議!
'the_posts_pagination()'沒有'in_same_term'參數...但是,像['nex_post_link'](https://codex.wordpress.org/Function_Reference/next_post_link)做... – rnevius
@rnevius感謝那 - 你是說我應該能夠編寫一個單獨的功能(除了已有的「the_posts_pagination」功能)?或者我將它添加到function.php文件而不是這個post.php文件? – Pike800