Исправление вида виджета
-
Всем добрый вечер.
Есть виджет который выводит категори вакансий
Выгелдит так: http://rghost.ru/8YlBBdLld/image.png
А нужно что бы было так: http://rghost.ru/6HbCRpgzY/image.pngВот сам код виджета:
class Noo_Job_Category_Widget extends Noo_Wiget { public function __construct() { $this->widget_cssclass = 'noo-job-category-widget'; $this->widget_description = __( "Display Noo Job Categories.", 'noo' ); $this->widget_id = 'noo_job_category_widget'; $this->widget_name = __( 'Noo Job Categories', 'noo' ); $this->cached = true; $this->settings = array( 'title' => array( 'type' => 'text', 'std' => '', 'label' => __( 'Title', 'noo' ) ), 'count' => array( 'type' => 'checkbox', 'std' => 0, 'label' => __( 'Show Job Counts', 'noo' ) ), 'include_empty' => array( 'type' => 'checkbox', 'std' => 0, 'label' => __( 'Include Empty Categories', 'noo' ) ), 'hierarchical' => array( 'type' => 'checkbox', 'std' => 0, 'label' => __( 'Show Hierarchy', 'noo' ) ), ); parent::__construct(); } public function widget( $args, $instance ) { extract( $args ); $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ); $c = ! empty( $instance['count'] ) ? '1' : '0'; $h = ! empty( $instance['hierarchical'] ) ? '1' : '0'; $e = ! empty( $instance['include_empty'] ) ? '0' : '1'; $cat_args = array( 'taxonomy' =>'job_category', 'orderby' => 'name', 'show_count' => $c, 'hide_empty' => $e, 'hierarchical' => $h ); echo $args['before_widget']; if ( $title ) { echo $args['before_title'] . $title . $args['after_title']; } $categories = get_categories( $cat_args ); echo '<ul>'; echo walk_category_tree( $categories, 0, array( 'style' =>'dropdown', 'show_count' =>$c, 'hide_empty' => $e, 'hierarchical' =>$h, 'use_desc_for_title' =>1, )); echo '</ul>'; echo $args['after_widget']; } }
Как реализовать?
Просмотр 2 ответов — с 1 по 2 (всего 2)
Просмотр 2 ответов — с 1 по 2 (всего 2)
- Тема «Исправление вида виджета» закрыта для новых ответов.