admin管理员组文章数量:1122832
I have Used the function dynamic_sidebar('sidebarId')
in the sidebar.php
file.
and all the functionality of the sidebar is Working succsessfully
My Question is How To Change the Html of the sidebar widgets and add some classes in widget items To fit My Design ?
Thank You in advance
I have Used the function dynamic_sidebar('sidebarId')
in the sidebar.php
file.
and all the functionality of the sidebar is Working succsessfully
My Question is How To Change the Html of the sidebar widgets and add some classes in widget items To fit My Design ?
Thank You in advance
Share Improve this question asked Jul 16, 2018 at 12:26 Ali BeshirAli Beshir 1214 bronze badges2 Answers
Reset to default 0All the widgets of the filtered-nav already have their own class and ids, the categories widget has "widget_product_categories". So you can modify css of the widget using
<style>
.widget_product_categories h3 span {color:red}
.widget_product_categories li{color:blue}
</style>
the following widgets ( filter by attributes ) don't have a unique identifier class but they have a unique id easily find it by right-click-> inspect element I.E:
<style>
.#woocommerce_layered_nav-3 h3 {color:green}
.#woocommerce_layered_nav-3 li {color:gold}
</style>
About changing html it's more complicated, what we usually do is to create a new widget that conforms to specific needs
Every widget in WordPress get’s a unique ID/class if you look at the markup in inspect element you can see the classes or IDs.
There is also a quick fix solution to add classes to the widget using this plugin - https://wordpress.org/plugins/widget-css-classes/
You can also wrap the dynamic sidebar call with HTML tags something like :
<ul id="sidebar-left">
<?php dynamic_sidebar( 'left-sidebar' ); ?>
</ul>
本文标签: phpHow To Change The Html of Products filtration sidebar in Woocommerce
版权声明:本文标题:php - How To Change The Html of Products filtration sidebar in Woocommerce? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736284872a1927341.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论