如何以编程方式在WordPress中获取主题主色?

有没有一种方法可以获取活动主题的主色, 例如get_user_option(‘admin_color’)。否则最好的方法是什么?我知道主题选项存储在像theme_mods_twentyfifteen这样的wp_options下, 但是有没有更简单的方法来获取它?


#1


get_theme_mod()函数将最适合你的需求。这取决于主题实际上将某种主色选项保存为theme_mod(它们应该是, 实际上所有主题修改都应该是theme_mods而不是常规选项)。

来源:

https://www.srcmini02.com/63428.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_37622.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?