[优化篇]去除worpdress菜单多余的css样式-WordPress主题

摘要:[crayon-65b8d22e94950742065869/] 在wordpress主题菜单调用中,程序通常会默认生成…

在wordpress主题菜单调用中,程序通常会默认生成类似上面的累赘css属性样式;但通常我们在wordpress主题的制作开发过程中是用不到的这样繁杂的属性的;我们可以通过优化函数将默认的这样css选择器去除性。方法如下

在主题的functions.php文件件添加如下函数:

代码的第 9 行的数组内容保留了 class=”current-menu-item”等四个样式 ,让你可以自由定义当前菜单的高亮样式

最终呈现的代码如下;

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