'blog_expert_popular_post_widget', 'description' => __('Displays post form selected category specific for popular post in sidebars.', 'blog-expert'), 'customize_selective_refresh' => true, ); $fields = array( 'title' => array( 'label' => __('Title:', 'blog-expert'), 'type' => 'text', 'class' => 'widefat', ), 'post_category' => array( 'label' => __('Select Category:', 'blog-expert'), 'type' => 'dropdown-taxonomies', 'show_option_all' => __('All Categories', 'blog-expert'), ), 'post_number' => array( 'label' => __('Number of Posts:', 'blog-expert'), 'type' => 'number', 'default' => 4, 'css' => 'max-width:60px;', 'min' => 1, 'max' => 6, ), ); parent::__construct('blog-expert-popular-sidebar-layout', __('BB: Recent Post', 'blog-expert'), $opts, array(), $fields); } /** * Outputs the content for the current widget instance. * * @since 1.0.0 * * @param array $args Display arguments. * @param array $instance Settings for the current widget instance. */ function widget($args, $instance) { $params = $this->get_params($instance); echo $args['before_widget']; if (!empty($params['title'])) { echo $args['before_title'] . esc_html( $params['title'] ) . $args['after_title']; } $qargs = array( 'posts_per_page' => esc_attr($params['post_number']), 'no_found_rows' => true, ); if (absint($params['post_category']) > 0) { $qargs['cat'] = absint($params['post_category']); } $recent_posts_query = new WP_Query($qargs); $count = 1; if ($recent_posts_query->have_posts()) : ?>
    have_posts()) : $recent_posts_query->the_post(); ?>
  • <?php the_title_attribute(); ?>
'blog_expert_author_widget', 'description' => __('Displays authors details in post.', 'blog-expert'), 'customize_selective_refresh' => true, ); $fields = array( 'title' => array( 'label' => __('Title:', 'blog-expert'), 'type' => 'text', 'class' => 'widefat', ), 'author-name' => array( 'label' => __('Name:', 'blog-expert'), 'type' => 'text', 'class' => 'widefat', ), 'discription' => array( 'label' => __('Description:', 'blog-expert'), 'type' => 'textarea', 'class' => 'widget-content widefat' ), 'image_url' => array( 'label' => __('Author Image:', 'blog-expert'), 'type' => 'image', ), 'url-fb' => array( 'label' => __('Facebook URL:', 'blog-expert'), 'type' => 'url', 'class' => 'widefat', ), 'url-tw' => array( 'label' => __('Twitter URL:', 'blog-expert'), 'type' => 'url', 'class' => 'widefat', ), 'url-gp' => array( 'label' => __('Googleplus URL:', 'blog-expert'), 'type' => 'url', 'class' => 'widefat', ), 'url-lt' => array( 'label' => __('Linkedin URL:', 'blog-expert'), 'type' => 'url', 'class' => 'widefat', ), 'url-ig' => array( 'label' => __('Instagram URL:', 'blog-expert'), 'type' => 'url', 'class' => 'widefat', ), ); parent::__construct('blog-expert-author-layout', __('BB: Author Widget', 'blog-expert'), $opts, array(), $fields); } /** * Outputs the content for the current widget instance. * * @since 1.0.0 * * @param array $args Display arguments. * @param array $instance Settings for the current widget instance. */ function widget($args, $instance) { $params = $this->get_params($instance); echo $args['before_widget']; if ( ! empty( $params['title'] ) ) { echo $args['before_title'] . esc_html( $params['title'] ) . $args['after_title']; } ?>