/home/desid573/verdenaturopathy.com.au/wp-content/plugins/alx-extensions/inc/widgets
Edit: /home/desid573/verdenaturopathy.com.au/wp-content/plugins/alx-extensions/inc/widgets/alx-posts.php (9248B)
esc_html__( 'Display posts from a category', 'alx' ), 'classname' => 'widget_alx_posts', 'customize_selective_refresh' => true ) );
}
public function alx_get_defaults() {
return array(
'title' => '',
// Posts
'posts_thumb' => 1,
'posts_category'=> 1,
'posts_date' => 1,
'posts_num' => '4',
'posts_cat_id' => '0',
'posts_orderby' => 'date',
'posts_time' => '0',
);
}
/* Widget
/* ------------------------------------ */
public function widget($args, $instance) {
extract( $args );
$defaults = $this -> alx_get_defaults();
$instance = wp_parse_args( (array) $instance, $defaults );
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
$output = $before_widget."\n";
if($title)
$output .= $before_title.$title.$after_title;
ob_start();
?>
array( 'post' ),
'showposts' => absint( $instance['posts_num'] ),
'cat' => absint( $instance['posts_cat_id'] ),
'ignore_sticky_posts' => true,
'orderby' => esc_attr( $instance['posts_orderby'] ),
'order' => 'dsc',
'date_query' => array(
array(
'after' => esc_attr( $instance['posts_time'] ),
),
),
) );
?>
have_posts()): $posts->the_post(); ?>
-
'',
// Posts
'posts_thumb' => 1,
'posts_category' => 1,
'posts_date' => 1,
'posts_num' => '4',
'posts_cat_id' => '0',
'posts_orderby' => 'date',
'posts_time' => '0',
);
$instance = wp_parse_args( (array) $instance, $defaults );
?>