我正在寻找一种简单的方法来修改wordpress输出窗口小部件中类别列表的方式。
<li class="cat-item cat-item-12 current-cat"><a href="https://mywebsite.com/category/pharmacotherapie-observance-adhesion-therapeutique/"><span style="display: block; margin: 0 0 0 20px;">Pharmacothérapie et observance et/ou adhésion thérapeutique</span></a>
我需要这样显示它。
var bounds = new google.maps.LatLngBounds(); // declaration
var data = snapshot.val();
var marker = new google.maps.Marker({
position: {
lat: data.lat,
lng: data.lng
},
map: map
});
我会更喜欢在我的主题的function.php文件中进行。我不想使用jQuery或编辑wordpress核心代码。
答案 0 :(得分:0)
我们需要在WordPress中的许多地方使用WordPress默认文本小部件的原始行为。因此,您必须将自定义文本小部件创建为WordPress插件,然后像使用默认文本小部件一样使用它。
创建WordPress自定义窗口小部件非常简单,只需将其粘贴到functions.php
:
require_once("your_widget.php");
add_action("widgets_init", "your_custom_widgets_init");
function your_custom_widgets_init(){
register_widget("Your_Custom_Widget_Class");
}
然后你有办法为列表编写自己的CSS,而不是强制添加span类。您可以做任何事情,因为“Your_Custom_Widget”的CSS将由您控制。