__( 'Displays a list of Child Categories including Post Titles and links of your chosen Parent Category', 'wpb_widget_domain' ), ) ); } // Creating widget front-end // This is where the action happens public function widget( $args, $instance ) { if( $c = get_category(@$instance['category_id']) ){ foreach(get_categories(array( "child_of" => $c->cat_ID, "orderby" => "count", "order" => "DESC", )) as $childCat){ echo '
'; echo ('

'.''.$childCat->name.'

'); echo ''; echo "
"; } } } // Widget Backend public function form( $instance ) { if ( isset( $instance[ 'title' ] ) ) { $title = $instance[ 'title' ]; } else { $title = __( 'New title', 'wpb_widget_domain' ); } // Widget admin form echo '

Choose your parent category

'; wp_dropdown_categories(array( "id" => $this->get_field_id('category_id'), "name" => $this->get_field_name("category_id"), "selected" => @$instance["category_id"], "children" => 'TRUE', "hide_empty" => '0', )); ?>