__('Customized Facebook LikeBox Widget for your WordPress Website.', 'pg_fb_likebox'),) // Args ); } //output widget content public function widget($args, $instance) { //Display widget according to user settings $display_widget = false; if (is_front_page() && $instance['fb_front_page']) { $display_widget = true; } if (is_page() && $instance['fb_pages']) { $display_widget = true; } if (is_tag() && $instance['fb_tags']) { $display_widget = true; } if (is_category() && $instance['fb_cats']) { $display_widget = true; } if (is_singular('post') && $instance['fb_posts']) { $display_widget = true; } if (!is_singular('post') && $instance['fb_custom_posts']) { $display_widget = true; } if ($display_widget) { //output widget echo $args['before_widget']; if (!empty($instance['title'])) { echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title']; //title } $facebook_page_url = (!empty($instance['fb_page_url'])) ? $instance['fb_page_url'] : ''; //fb page url $fb_likebox_color = (!empty($instance['fb_likebox_color'])) ? 'data-colorscheme="' . $instance['fb_likebox_color'] . '"' : 'data-colorscheme="light"'; //fb color scheme $fb_show_face = ($instance['fb_show_face']) ? 'data-show-faces="true"' : 'data-show-faces="false"'; //fb show faces $fb_show_header = ($instance['fb_show_header']) ? 'data-header="true"' : 'data-header="false"'; //fb show header $fb_show_posts = ($instance['fb_show_posts']) ? 'data-stream="true"' : 'data-stream="false"'; //fb show stream posts $fb_show_border = ($instance['fb_show_border']) ? 'data-show-border="true"' : 'data-show-border="false"'; //fb show border //facebook Likebox code echo '
'; echo ''; echo ''; echo $args['after_widget']; } } //display options for widget admin public function form($instance) { //title of widget $title = (isset($instance['title'])) ? $instance['title'] : __('New title', 'text_domain'); echo ''; echo ' '; echo ''; echo '
'; //Facebook Page URL $fb_page_url = (isset($instance['fb_page_url'])) ? $instance['fb_page_url'] : __('https://www.facebook.com/saurabhspeaks', 'text_domain'); echo ''; echo ' '; echo ''; echo '
'; //Facebook LikeBox Width $fb_likebox_width = (isset($instance['fb_likebox_width'])) ? $instance['fb_likebox_width'] : __('300', 'text_domain'); echo ''; echo ' '; echo ''; echo '
'; //Facebook LikeBox Height $fb_likebox_height = (isset($instance['fb_likebox_height'])) ? $instance['fb_likebox_height'] : __('300', 'text_domain'); echo ''; echo ' '; echo ''; echo '
'; //Facebook LikeBox Color Scheme $fb_likebox_color = (isset($instance['fb_likebox_color'])) ? $instance['fb_likebox_color'] : ''; echo ''; echo ' '; echo ''; echo '
'; //Facebook Customization options echo ''; $fb_show_face = ($instance['fb_show_face']) ? 'checked' : ''; $fb_show_header = ($instance['fb_show_header']) ? 'checked' : ''; $fb_show_posts = ($instance['fb_show_posts']) ? 'checked' : ''; $fb_show_border = ($instance['fb_show_border']) ? 'checked' : ''; echo ' '; echo '
'; $fb_front_page = ($instance['fb_front_page']) ? 'checked' : ''; $fb_pages = ($instance['fb_pages']) ? 'checked' : ''; $fb_tags = ($instance['fb_tags']) ? 'checked' : ''; $fb_cats = ($instance['fb_cats']) ? 'checked' : ''; $fb_posts = ($instance['fb_posts']) ? 'checked' : ''; $fb_custom_posts = ($instance['fb_custom_posts']) ? 'checked' : ''; echo ' '; echo '