__( 'Choose between 1 of 5 ways to display a custom category of posts.', 'lycanthropy' ), ) ); } // Front-end Widget public function widget( $args, $instance ) { $title = apply_filters( 'widget_title', $instance['title'] ); $category_id = $instance['category_id']; $type = $instance['type']; $num_posts = absint( $instance['num_posts'] ); $post_offset = absint ( $instance['post_offset'] ); global $post; ////////////////////////////// LISTA ////////////////////////////// if($type == 'lista') : echo $args['before_widget']; if ( $title ) echo $args['before_title'] . $title . $args['after_title']; $cats_to_include = ( $category_id ) ? "cat={$category_id}&": ''; $num_posts_query = new WP_Query( "{$cats_to_include}showposts={$num_posts}&offset={$post_offset}" ); if( $num_posts_query->have_posts()) : ?> have_posts()) : $num_posts_query->the_post(); update_post_caches($posts); ?>
ID ), 'list' ); ?> <?php the_title(); ?>. <?php the_title(); ?>.

have_posts()) : ?> have_posts()) : $num_posts_query->the_post(); update_post_caches($posts); ?>
ID ), 'grid2' ); ?> <?php the_title(); ?>. <?php the_title(); ?>.

ID ), 'grid2' ); ?> <?php the_title(); ?>. <?php the_title(); ?>.

have_posts()) : ?> have_posts()) : $num_posts_query->the_post(); update_post_caches($posts); ?>
ID ), 'grid3' ); ?> <?php the_title(); ?>. <?php the_title(); ?>.

ID ), 'grid3' ); ?> <?php the_title(); ?>. <?php the_title(); ?>.

have_posts()) : ?> have_posts()) : $num_posts_query->the_post(); update_post_caches($posts); ?>
ID ), 'widget' ); ?> <?php the_title(); ?>. <?php the_title(); ?>.

have_posts()) : ?> have_posts()) : $num_posts_query->the_post(); update_post_caches($posts); ?>
ID ), 'slider' ); ?> <?php the_title(); ?>. <?php the_title(); ?>.
esc_html('Custom Post'), 'category_id' => '', 'type' => 1, 'num_posts' => 3, 'post_offset' => 0); $instance = wp_parse_args ( (array) $instance, $defaults ); ?>

get_field_name( 'category_id' ).'&class=widefat'); ?>