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() { // widgets.css wp_enqueue_style('admin-styles', get_template_directory_uri() . '/inc/widgets/widgets.css'); wp_enqueue_media(); wp_enqueue_script( 'wp-color-picker' ); wp_enqueue_script( 'easyblog-media-upload-js', 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', __( 'Daisy: Social Icons', 'easyblog' ), array( 'classname' => 'dt-social-icons', 'description' => __( 'Social Icons', 'easyblog' ) ) ); } public function widget( $args, $instance ) { extract( $args, EXTR_SKIP ); $title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : ''; $facebook = isset( $instance[ 'facebook' ] ) ? $instance[ 'facebook' ] : ''; $twitter = isset( $instance[ 'twitter' ] ) ? $instance[ 'twitter' ] : ''; $g_plus = isset( $instance[ 'g-plus' ] ) ? $instance[ 'g-plus' ] : ''; $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' ] : ''; echo $before_widget; ?>

'', 'facebook' => '', 'twitter' => '', 'g-plus' => '', 'instagram' => '', 'github' => '', 'flickr' => '', 'pinterest' => '', 'wordpress' => '', 'youtube' => '', 'vimeo' => '', 'linkedin' => '', 'behance' => '', 'dribbble' => '' ) ); ?>
'dt-ads', 'description' => __( 'Advertisement for sidebar', 'easyblog' ) ) ); } public function widget( $args, $instance ) { extract( $args, EXTR_SKIP ); $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 = __( 'Ads', 'easyblog' ); }; if( empty( $ads_image_path ) ) { $ads_image_path = ''; }; if( empty( $ads_link ) ) { $ads_link = esc_url( 'http://daisythemes.com/', 'easyblog') ; }; echo $before_widget; ?> <?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 ) { extract( $args, EXTR_SKIP ); 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 ) ); echo $before_widget; ?>

have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
ID ); $image .= ''; $image .= get_the_post_thumbnail( $post->ID, 'dt-recent-posts-img', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).''; echo $image; endif; ?>

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