'bln-twp', 'description' => __('Use this widget to display a Text Widget+ in your sidebar.', BLN_TEXTDOMAIN)); $control_ops = array('id_base' => 'bln-twp'); $this->WP_Widget('bln-twp', 'Text Widget +', $widget_ops, $control_ops); } // Display the widget public function widget($args, $instance) { extract($args); $id = $instance['id']; $page = get_post($id); if (!empty($page)) { $title = $page->post_title; echo $before_widget; echo $before_title . $title . $after_title; if (has_post_thumbnail($id)) { $widgets = wp_get_sidebars_widgets(); $count = (isset($widgets['sidebar3'])) ? count($widgets['sidebar3']) : 0; $thumb_id = get_post_thumbnail_id($id); $size = (2 > $count) ? array(400, 400) : 'full'; $literal_size = (is_array($size)) ? implode('x', $size) : 'full'; echo wp_get_attachment_image($thumb_id, $size, false, array( 'class' => 'attachment-' . $thumb_id . ' twplus-thumb-' . $literal_size . ' img-polaroid aligncenter', 'alt' => esc_attr($title), ) ); } $content = apply_filters('bln_twplus_content', $page->post_content); ?>