'Sidebar', 'id' => 'sidebar-1', 'description' => __( 'Widgets in this area will be shown on the bottom side.', 'patria' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' )); } add_action( 'widgets_init', 'patria_widgets_init' ); /* * 4. Patria recent posts widget */ class PatriaRecentPost extends WP_Widget { // Widget constructor function __construct() { parent::__construct( // Base ID of widget 'PatriaRecentPost', // Widget name __('Patria recent posts', 'patria') ); } // Creating widget front-end function widget( $args, $instance ) { $title = apply_filters( 'widget_title', $instance['title'] ); $number = apply_filters( 'widget_number', $instance['number'] ); // Title echo $args['before_widget']; if ( ! empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; // Widget echo '