我需要创建一个由一对按钮组成的自定义WordPress小部件。每个按钮将链接到不同的位置。将小部件放到边栏中时, 我只需要能够编辑每个按钮的标题和href。
我已经创建了自定义窗口小部件区域, 并且知道如何实现这些区域, 并遵循了一些教程来创建自定义窗口小部件, 但是似乎无法理解如何使选项可编辑。
这是小部件将输出的代码示例:
<div class="col-xs-6">
<a class="mycustombutton" href="#" target="_blank">Text Here</a>
</div>
<div class="col-xs-6">
<a class="mycustombutton" href="#" target="_blank">Text Here</a>
</div>
理想情况下, 我可以在网站上的任何位置使用此小部件来添加这些按钮, 但可以根据需要更改按钮的href。
#1
如果你不熟悉WordPress, 则可以暂时使用类似此类的Widget Generator, 然后研究其生成的代码以了解其工作原理。
你也可以查看Widgets文档以创建自定义Widget。
来源:
https://www.srcmini02.com/63209.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_41943.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57