esc_html__( 'Blog Sidebar Widget Area', 'ailabflow' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'This is sidebar for blog.', 'ailabflow' ),
'before_widget' => '',
'before_title' => '
',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Page Sidebar Widget Area', 'ailabflow' ),
'id' => 'page-sidebar',
'description' => esc_html__( 'This is sidebar for pages.', 'ailabflow' ),
'before_widget' => '',
'before_title' => '',
)
);
if ( class_exists( 'Redux' ) ) {
// Footer sidebars.
register_sidebar(
array(
'name' => esc_html__( 'Footer - 1st Widget Area ', 'ailabflow' ),
'id' => 'footer-column-1',
'description' => esc_html__( 'This is first footer widget area for footer.', 'ailabflow' ),
'before_widget' => '',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer - 2nd Widget Area', 'ailabflow' ),
'id' => 'footer-column-2',
'description' => esc_html__( 'This is second footer widget area for footer.', 'ailabflow' ),
'before_widget' => '',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer - 3rd Widget Area', 'ailabflow' ),
'id' => 'footer-column-3',
'description' => esc_html__( 'This is third footer widget area for footer.', 'ailabflow' ),
'before_widget' => '',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer - 4th Widget Area', 'ailabflow' ),
'id' => 'footer-column-4',
'description' => esc_html__( 'This is fourth footer widget area for footer.', 'ailabflow' ),
'before_widget' => '',
'before_title' => '',
)
);
}
}
add_action( 'widgets_init', 'ailabflow_widgets_init' );
class ailabflow_recent_posts extends WP_Widget {
function __construct() {
$widget_ops = array('classname' => 'themetechmount_widget_recent_entries', 'description' => esc_html__( "Your site’s most recent Posts.", 'ailabflow') );
parent::__construct('themetechmount-recent-posts', esc_html__('ailabflow Recent Posts', 'ailabflow'), $widget_ops);
$this->alt_option_name = 'widget_recent_entries';
}
function widget($args, $instance) {
if ( ! isset( $args['widget_id'] ) )
$args['widget_id'] = $this->id;
//ob_start();
extract($args);
$title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : esc_attr__( 'Recent Posts', 'ailabflow' );
$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
$number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 3;
if ( ! $number )
$number = 3;
$r = new WP_Query( array(
'posts_per_page' => $number,
'no_found_rows' => true,
'post_status' => 'publish',
'ignore_sticky_posts' => true
));
?>
have_posts()) :
?>
array(
'id' => array(),
'class' => array(),
),
'div' => array(
'id' => array(),
'class' => array(),
),
'section' => array(
'id' => array(),
'class' => array(),
),
'span' => array(
'class' => array(),
),
'h2' => array(
'class' => array(),
'id' => array(),
),
'h3' => array(
'class' => array(),
'id' => array(),
),
'h4' => array(
'class' => array(),
'id' => array(),
),
)
);
?>
array(
'id' => array(),
'class' => array(),
),
'div' => array(
'id' => array(),
'class' => array(),
),
'section' => array(
'id' => array(),
'class' => array(),
),
'span' => array(
'class' => array(),
),
'h2' => array(
'class' => array(),
'id' => array(),
),
'h3' => array(
'class' => array(),
'id' => array(),
),
'h4' => array(
'class' => array(),
'id' => array(),
),
)
);
}
?>
have_posts()){
while ( $r->have_posts() ) :
$r->the_post();
echo ailabflow_recent_posts( $r );
endwhile;
}
?>
array(
'id' => array(),
'class' => array(),
),
'div' => array(
'id' => array(),
'class' => array(),
),
'span' => array(
'class' => array(),
),
'h2' => array(
'class' => array(),
'id' => array(),
),
'h3' => array(
'class' => array(),
'id' => array(),
),
'h4' => array(
'class' => array(),
'id' => array(),
),
)
);
?>