'widget_post_categories', 'description' => __( 'Use only for single template' , 'cannyon' ) )); } function widget( $args, $instance ) { /* PRINT THE WIDGET */ extract( $args , EXTR_SKIP ); $instance = wp_parse_args( (array) $instance, array( 'title' => '' )); $title = $instance[ 'title' ]; if( is_singular( 'post' ) && has_category( ) ){ echo $before_widget; if( !empty( $title ) ){ echo $before_title; echo apply_filters( 'widget_title', esc_attr( $title ), $instance, $this -> id_base ); echo $after_title; } echo '
'; echo ''; echo '
'; } } register_widget( 'mythemes_post_categories' ); } /* END IF CLASS EXISTS */ ?>