esc_html__( 'Right Sidebar', 'easyblog' ), 'id' => 'dt-sidebar', 'description' => __( 'Add widgets to Show widgets at right panel of page', 'easyblog' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); // Register front page sidebar before Content register_sidebar( array( 'name' => esc_html__( 'Front Page: Before Content', 'easyblog' ), 'id' => 'dt-front-page-before-content', 'description' => __( 'Add widgets to show at Frontpage Before Content', 'easyblog' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); // Register front page sidebar after Content register_sidebar( array( 'name' => esc_html__( 'Front Page: After Content', 'easyblog' ), 'id' => 'dt-front-page-after-content', 'description' => __( 'Add widgets to show at Frontpage After Content', 'easyblog' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'easyblog_widgets_init' ); /** * Enqueue Admin Scripts */ function easyblog_media_script( $hook ) { if ( 'widgets.php' != $hook ) { return; } wp_enqueue_style('easyblog-widget-style', get_template_directory_uri() . '/inc/widgets/widgets.css'); wp_enqueue_media(); wp_enqueue_script( 'easyblog-media-upload', get_template_directory_uri() . '/inc/widgets/widgets.js', array( 'jquery' ), '', true ); } add_action( 'admin_enqueue_scripts', 'easyblog_media_script' ); /** * Social Icons widget. */ class easyblog_social_icons extends WP_Widget { public function __construct() { parent::__construct( 'easyblog_social_icons', __( 'Easyblog: Social Icons', 'easyblog' ), array( 'description' => __( 'Social Icons', 'easyblog' ) ) ); } public function widget( $args, $instance ) { $title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : ''; $facebook = isset( $instance[ 'facebook' ] ) ? $instance[ 'facebook' ] : ''; $twitter = isset( $instance[ 'twitter' ] ) ? $instance[ 'twitter' ] : ''; $instagram = isset( $instance[ 'instagram' ] ) ? $instance[ 'instagram' ] : ''; $github = isset( $instance[ 'github' ] ) ? $instance[ 'github' ] : ''; $flickr = isset( $instance[ 'flickr' ] ) ? $instance[ 'flickr' ] : ''; $pinterest = isset( $instance[ 'pinterest' ] ) ? $instance[ 'pinterest' ] : ''; $wordpress = isset( $instance[ 'wordpress' ] ) ? $instance[ 'wordpress' ] : ''; $youtube = isset( $instance[ 'youtube' ] ) ? $instance[ 'youtube' ] : ''; $vimeo = isset( $instance[ 'vimeo' ] ) ? $instance[ 'vimeo' ] : ''; $linkedin = isset( $instance[ 'linkedin' ] ) ? $instance[ 'linkedin' ] : ''; $behance = isset( $instance[ 'behance' ] ) ? $instance[ 'behance' ] : ''; $dribbble = isset( $instance[ 'dribbble' ] ) ? $instance[ 'dribbble' ] : ''; ?>

'', 'facebook' => '', 'twitter' => '', 'instagram' => '', 'github' => '', 'flickr' => '', 'pinterest' => '', 'wordpress' => '', 'youtube' => '', 'vimeo' => '', 'linkedin' => '', 'behance' => '', 'dribbble' => '' ) ); ?>
">
__( 'Advertisement for sidebar', 'easyblog' ) ) ); } public function widget( $args, $instance ) { $title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : ''; $ads_image_path = isset( $instance[ 'ads_image' ] ) ? $instance[ 'ads_image' ] : ''; $ads_link = isset( $instance[ 'ads_link' ] ) ? $instance[ 'ads_link' ] : ''; if( empty( $title ) ) { $title = __( 'Advertisement', 'easyblog' ); }; if( empty( $ads_image_path ) ) { $ads_image_path = ''; }; ?>
<?php echo esc_attr( $title ); ?>
'', 'ads_link' => '', 'ads_image' => '' ) ); ?>
'dt-recent-posts', 'description' => __( 'Show Recent Posts with thumbnail image', 'easyblog' ) ) ); } public function widget( $args, $instance ) { global $post; $title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : ''; $category = isset( $instance[ 'category' ] ) ? $instance[ 'category' ] : ''; $no_of_posts = isset( $instance[ 'no_of_posts' ] ) ? $instance[ 'no_of_posts' ] : ''; $query = new WP_Query( array( 'post_type' => 'post', 'category__in' => $category, 'posts_per_page' => $no_of_posts ) ); ?>

have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>

'', 'category' => '', 'no_of_posts' => '5' ) ); ?>