__( 'Displays posts with Titles underneath thumbnail image', 'postmag' ) ) ); } private function defaults(){ $defaults = array( 'categoryListings' => '', 'categryorformat' => 3, 'postformat' => '', 'content' => 0, 'noofcolume' => 1, 'shadow' => 0, ); return $defaults; } public function form( $instance) { $instance = wp_parse_args( (array) $instance, $this->defaults() ); $categoryListings = $instance[ 'categoryListings' ]; $categryorformat = $instance[ 'categryorformat' ]; $postformat = $instance[ 'postformat' ]; $content = $instance[ 'content' ]; $noofcolume = $instance[ 'noofcolume' ]; $shadow = $instance[ 'shadow' ]; ?> id = "get_field_id( 'content' ) ); ?>" name = "get_field_name( 'content' ) ); ?>" />
id = "get_field_id( 'shadow' ) ); ?>" name = "get_field_name( 'shadow' ) ); ?>" />

size = "1" /> __('Select post by format','postmag'), 'orderby' => 'name', 'order' => 'asc', 'show_count' => 1, 'hide_empty' => 1, 'echo' => 1, 'selected' => $postformat, 'hierarchical' => 1, 'name' => esc_html( $this->get_field_name('postformat') ), 'id' => absint( $this->get_field_id('postformat') ), 'class' => 'widefat', 'taxonomy' => 'post_format', 'value_field' => 'name', ); wp_dropdown_categories($postmag_postformat); ?> size = "1" />
size = "1" /> __( 'Select post by category','postmag' ), 'option_none_value' => __( 'none', 'postmag' ), 'orderby' => 'name', 'order' => 'asc', 'show_count' => 1, 'hide_empty' => 1, 'echo' => 1, 'selected' => $categoryListings, 'hierarchical' => 1, 'name' => esc_html( $this->get_field_name('categoryListings') ), 'id' => absint( $this->get_field_id('categoryListings') ), 'class' => 'widefat', 'taxonomy' => 'category', 'value_field' => 'name', ); wp_dropdown_categories($postmag_categoryListings); ?>


size = "1" />
size = "1" />
size = "1" /> size = "1" /> size = "1" />

defaults()); $categoryListings = $instance[ 'categoryListings' ]; $categryorformat = $instance[ 'categryorformat' ]; $postformat = $instance[ 'postformat' ]; $content = $instance[ 'content' ]; $shadow = $instance[ 'shadow' ]; $noofcolume = $instance[ 'noofcolume' ]; echo $args['before_widget']; $this->getRealtyListings( $categoryListings,$categryorformat,$postformat,$content,$noofcolume,$shadow ); echo $args['after_widget']; } private function getRealtyListings( $categoryListings,$categryorformat,$postformat,$content,$noofcolume,$shadow ) { if ( absint( $categryorformat ) == 2 ) { ?>
'post', 'posts_per_page' => absint( $noofcolume ), ); if ( absint( $categryorformat ) == 1 ) { $args = array( 'post_format' => 'post-format-'.esc_html( $postformat ), 'posts_per_page' => absint( $noofcolume ), ); } if ( absint( $categryorformat ) == 2 ) { $args = array( 'category_name' => esc_html( $categoryListings ), 'posts_per_page' => absint( $noofcolume ), ); } if ( absint( $categryorformat ) == 3 ) { $args = array( 'post_type' => 'post', 'posts_per_page' => absint( $noofcolume ), ); } $listings = new WP_Query( $args ); $noofcolume = 12/absint( $noofcolume ) ; if ( $listings->have_posts() ) { while ( $listings-> have_posts() ) { $listings->the_post(); ?>