2013-12-16 117 views
1

如何將PARAMETERS添加到此WP function next_post_link()如何將wordpress過濾器添加到add_filter到next_post_link

add_filter ('next_post_link', 'new_next_post_link'); 
function new_next_post_link ($args) { 

in_same_cat ?????? 

return $args; 
} 

我需要通過FILTER原因去改變它,我不能在主題改變它。我試過這個。

add_filter ('next_post_link', 'new_next_post_link'); 
function new_next_post_link ($args) { 

$args = "Hello World"; 

return $args; 
} 

這個工作,所以我需要知道如何改變的 「Hello World」 到next_post_link( '%鏈接', '下一篇文章在分類',TRUE);

乾杯, 丹尼斯

回答

0

你不需要。第三個參數是in_same_cat(布爾)。默認情況下它被設置爲false。

<?php next_post_link($format, $link, true); ?> 

http://codex.wordpress.org/Function_Reference/next_post_link

+0

嘿塞繆爾,謝謝您的回答,但我不能/要更改主題。我需要在我的孩子主題functions.php中做到這一點。 – user1600867

相關問題