'royal_magazine_grid_panel_widget', 'description' => __('Displays posts from selected category in grid.', 'royal-magazine'), 'customize_selective_refresh' => true, ); $fields = array( 'title' => array( 'label' => __('Title:', 'royal-magazine'), 'type' => 'text', 'class' => 'widefat', ), 'post_category' => array( 'label' => __('Select Category:', 'royal-magazine'), 'type' => 'dropdown-taxonomies', 'show_option_all' => __('All Categories', 'royal-magazine'), ), 'post_number' => array( 'label' => __('Number of Posts:', 'royal-magazine'), 'type' => 'number', 'default' => 4, 'css' => 'max-width:60px;', 'min' => 1, 'max' => 10, ), ); parent::__construct('royal-magazine-grid-layout', __('RM: Grid Content Widget', 'royal-magazine'), $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'] . $params['title'] . $args['after_title']; } $qargs = array( 'posts_per_page' => absint($params['post_number']), 'no_found_rows' => true, ); if (absint($params['post_category']) > 0) { $qargs['category'] = absint($params['post_category']); } $all_posts = get_posts($qargs); ?> post_author; ?>
$post) : ?>
'royal_magazine_list_panel_widget', 'description' => __('Displays post form selected category on List Format.', 'royal-magazine'), 'customize_selective_refresh' => true, ); $fields = array( 'title' => array( 'label' => __('Title:', 'royal-magazine'), 'type' => 'text', 'class' => 'widefat', ), 'post_category' => array( 'label' => __('Select Category:', 'royal-magazine'), 'type' => 'dropdown-taxonomies', 'show_option_all' => __('All Categories', 'royal-magazine'), ), 'post_number' => array( 'label' => __('Number of Posts:', 'royal-magazine'), 'type' => 'number', 'default' => 6, 'css' => 'max-width:60px;', 'min' => 1, 'max' => 10, ), 'excerpt_length' => array( 'label' => __('Excerpt Length:', 'royal-magazine'), 'description' => __('Number of words', 'royal-magazine'), 'type' => 'number', 'css' => 'max-width:60px;', 'default' => 20, 'min' => 0, 'max' => 200, ), ); parent::__construct('royal-magazine-list-layout', __('RM: Panel Content Widget', 'royal-magazine'), $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'] . $params['title'] . $args['after_title']; } $qargs = array( 'posts_per_page' => absint($params['post_number']), 'no_found_rows' => true, ); if (absint($params['post_category']) > 0) { $qargs['category'] = absint($params['post_category']); } $all_posts = get_posts($qargs); ?> post_author; $i = 0; ?>
$post) : ?>

0) : ?>

0) : ?>
'royal_magazine_popular_post_widget', 'description' => __('Displays post form selected category specific for popular post in sidebars.', 'royal-magazine'), 'customize_selective_refresh' => true, ); $fields = array( 'title' => array( 'label' => __('Title:', 'royal-magazine'), 'type' => 'text', 'class' => 'widefat', ), 'post_category' => array( 'label' => __('Select Category:', 'royal-magazine'), 'type' => 'dropdown-taxonomies', 'show_option_all' => __('All Categories', 'royal-magazine'), ), 'enable_discription' => array( 'label' => __('Enable Description:', 'royal-magazine'), 'type' => 'checkbox', 'default' => false, ), 'excerpt_length' => array( 'label' => __('Excerpt Length:', 'royal-magazine'), 'description' => __('Number of words', 'royal-magazine'), 'default' => 15, 'css' => 'max-width:60px;', 'min' => 0, 'max' => 200, ), 'post_number' => array( 'label' => __('Number of Posts:', 'royal-magazine'), 'type' => 'number', 'default' => 4, 'css' => 'max-width:60px;', 'min' => 1, 'max' => 6, ), ); parent::__construct('royal-magazine-popular-sidebar-layout', __('RM: Recent Post Widget', 'royal-magazine'), $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'] . $params['title'] . $args['after_title']; } $qargs = array( 'posts_per_page' => absint($params['post_number']), 'no_found_rows' => true, ); if (absint($params['post_category']) > 0) { $qargs['category'] = absint($params['post_category']); } $all_posts = get_posts($qargs); $count = 1; global $post; ?>
'royal_magazine_widget_tabbed', 'description' => __('Tabbed widget.', 'royal-magazine'), ); $fields = array( 'popular_heading' => array( 'label' => __('Popular', 'royal-magazine'), 'type' => 'heading', ), 'popular_number' => array( 'label' => __('No. of Posts:', 'royal-magazine'), 'type' => 'number', 'css' => 'max-width:60px;', 'default' => 5, 'min' => 1, 'max' => 10, ), 'enable_discription' => array( 'label' => __('Enable Description:', 'royal-magazine'), 'type' => 'checkbox', 'default' => true, ), 'excerpt_length' => array( 'label' => __('Excerpt Length:', 'royal-magazine'), 'description' => __('Number of words', 'royal-magazine'), 'default' => 10, 'css' => 'max-width:60px;', 'min' => 0, 'max' => 200, ), 'recent_heading' => array( 'label' => __('Recent', 'royal-magazine'), 'type' => 'heading', ), 'recent_number' => array( 'label' => __('No. of Posts:', 'royal-magazine'), 'type' => 'number', 'css' => 'max-width:60px;', 'default' => 5, 'min' => 1, 'max' => 10, ), 'comments_heading' => array( 'label' => __('Comments', 'royal-magazine'), 'type' => 'heading', ), 'comments_number' => array( 'label' => __('No. of Comments:', 'royal-magazine'), 'type' => 'number', 'css' => 'max-width:60px;', 'default' => 5, 'min' => 1, 'max' => 10, ), ); parent::__construct('royal-magazine-tabbed', __('RM: Tab Widgets', 'royal-magazine'), $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); $tab_id = 'tabbed-' . $this->number; echo $args['before_widget']; ?>
render_news('recent', $params); ?>
render_comments($params); ?>
$params['popular_number'], 'no_found_rows' => true, 'orderby' => 'comment_count', ); break; case 'recent': $qargs = array( 'posts_per_page' => $params['recent_number'], 'no_found_rows' => true, ); break; default: break; } $all_posts = get_posts($qargs); ?> $params['comments_number'], 'status' => 'approve', 'post_status' => 'publish', ); $comments = get_comments($comment_args); ?> 'royal_magazine_author_widget', 'description' => __('Displays authors details in post.', 'royal-magazine'), 'customize_selective_refresh' => true, ); $fields = array( 'title' => array( 'label' => __('Title:', 'royal-magazine'), 'type' => 'text', 'class' => 'widefat', ), 'author-name' => array( 'label' => __('Name:', 'royal-magazine'), 'type' => 'text', 'class' => 'widefat', ), 'discription' => array( 'label' => __('Description:', 'royal-magazine'), 'type' => 'textarea', 'class' => 'widget-content widefat' ), 'image_url' => array( 'label' => __('Author Image:', 'royal-magazine'), 'type' => 'image', ), 'url-fb' => array( 'label' => __('Facebook URL:', 'royal-magazine'), 'type' => 'url', 'class' => 'widefat', ), 'url-tw' => array( 'label' => __('Twitter URL:', 'royal-magazine'), 'type' => 'url', 'class' => 'widefat', ), 'url-gp' => array( 'label' => __('Googleplus URL:', 'royal-magazine'), 'type' => 'url', 'class' => 'widefat', ), ); parent::__construct('royal-magazine-author-layout', __('RM: Author Widget', 'royal-magazine'), $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'] . $params['title'] . $args['after_title']; } ?>