在不创建新表的情况下为WordPress插件存储变量

我正在创建一个自定义主题, 该主题提供了一种更改WordPress网站首页布局的方法。我想给用户3个选项供你选择, 然后基于该选择, 我将为主页设置不同的样式。我知道如何让用户选择布局, 但是我不想创建一个新表只是为了存储这一信息。我可以在其他地方存储此变量作为主题吗?谢谢。


#1


检出add_option()和get_option()函数。你的键/值对将存储在wp_options表中。

来源:

https://www.srcmini02.com/67480.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_36890.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?