我聲明我function.php文件這個過濾器:添加WordPress的過濾器錯誤
<?php
add_filter('next_posts_link_attributes', 'posts_link_attributes');
function posts_link_attributes() {
return 'class="styled-button"';
}
?>
,但把它恢復:因爲我的index.php
使用next_post_link()Fatal error: Cannot redeclare posts_link_attributes() (previously declared in functions.php in index.php)
有沒有解決方案?這不起作用的原因?
感謝您的幫助!
真棒感謝的作品!我不知道它已經被「使用」了:)。 – cmplieger
@SnippetSpace沒有問題。剛剛添加了如何檢查函數是否存在。 – iambriansreed
感謝您的信息,非常有幫助:) – cmplieger