php - Adding ul class to function output -
i have function. shows that.
<div id="sidebar-category"><h2 class="sidebar-title black">konular</h2> <ul> <li class="cat-item cat-item-2"><a href="http://www.domain.com/cats/girisimler/" >girişimler</a> </li> <li class="cat-item cat-item-3"><a href="http://www.domain.com/cats/isletme-yonetimi/" >İşletme yönetimi</a> </li> <li class="cat-item cat-item-4"><a href="http://www.domain.com/cats/proje-yonetimi/" >proje yönetimi</a> </li> <li class="cat-item cat-item-6"><a href="http://www.domain.com/cats/web-dunyasi/" >web dünyası</a> </li> </ul> </div>
how can add class in <ul>
?
this function :
function arphabet_widgets_init() { register_sidebar( array( 'name' => 'home right sidebar', 'id' => 'home_right_1', 'before_widget' => '<div id="sidebar-category">', 'after_widget' => '</div>', 'before_title' => '<h2 class="sidebar-title black">', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'arphabet_widgets_init' );
i show html code
<?php dynamic_sidebar( 'home_right_1' ); ?>
i see using wordpress. can edit ul in widget add class manually? if not, use jquery (present in wordpress) add class:
$('#sidebar-category ul').addclass('myclass');
be sure loads after dom ready:
$(document).ready(function() { $('#sidebar-category ul').addclass('myclass'); });
Comments
Post a Comment