我有许多不同帖子类型的自定义模板,我正在手动在每个模板的“entry meta”页脚中插入一个社交共享栏。我需要一种简单的集中式方法来禁用社交共享栏,而不必侵入插件。
到目前为止,我基本上都有这样的设置:
在里面functions.php:
update_option( \'show_social_bar\', \'true\' );
if( get_option( \'show_social_bar\' ) === \'true\' ) {
// show my social share links
}
如果需要关闭该栏,我只需在中将选项设置为“false”functions.php. 这似乎效率低下。有没有更明智的方法?