我声明我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