Different sidebars not changing

Your main problem is that the is_page() conditional will not return true if it is included inside or after the loop. Your other issue which is not necessarily related to the issue at hand is the way you are including your sidebars. WordPress comes with a handy little function called get_sidebar(). If you have more … Read more

Link listings with image

Why not use Links Categories? There you can use images, descriptions, create categories and sort out everything. There would be no need to create a widget as you can use the default WordPress one. Case you were to create your own widget, you can query these items with WordPress functions.

Add a specific css to a widget

If you register your sidebar this way, your all dynamic widgets gets a unique class automatically e.g. – class=”widget-container widget_archive” register_sidebar( array( ‘name’ => __( ‘Primary Widget Area’, ‘twentyten’ ), ‘id’ => ‘primary-widget-area’, ‘description’ => __( ‘The primary widget area’, ‘twentyten’ ), ‘before_widget’ => ‘<li id=”%1$s” class=”widget-container %2$s”>’, ‘after_widget’ => ‘</li>’, ‘before_title’ => ‘<h3 class=”widget-title”>’, … Read more

Display a widget on a specific type of archive

You could use the is_tax() function to accomplish this. The first parameter, the taxonomy slug is optional, but you do want to specify it. This would be something like product-categories. The second, a specific term, is also optional. It’d be perfectly acceptable to have the following: is_tax(‘product-categories’);

Recent Comments from Specific Category Widget

You could get your answer from Kovshenin blog Replace whole if ( $comments ) with this if ( $comments ) { foreach ( (array) $comments as $comment) { $comm_post_id = $comment->comment_post_ID; if ( $category_name ) { if (!in_category( “{$category_name}”, $comm_post_id )) { continue; } } $output .= ‘<li class=”recentcomments”>’ . /* translators: comments widget: 1: … Read more

dynamic sidebar in front page

loop-page.php is the wrong context for what you are trying to do. If you want it to appear on the home page, then you need to edit loop.php, so in your child theme you can either create a file called, loop.php …which should take precedence over the loop.php found in the parent TwentyTen theme or … Read more

Using wp_dropdown_categories in widget options

I got it 🙂 thanks to this function update( $new_instance, $old_instance ) { $instance = $old_instance; //Strip tags from title and name to remove HTML $instance[‘title’] = strip_tags( $new_instance[‘title’] ); $instance[‘kwtax’] = strip_tags( $new_instance[‘kwtax’] ); return $instance; } function form( $instance ) { //Set up some default widget settings. $defaults = array( ‘title’ => __(‘Equipment … Read more

Saving widget options from class method

Why are you writing your own save handlers for widgets? The update method your widget class will take care of this. You’re saving per widget settings, exactly what the Widget API was designed to do. <?php class WPSE76224_Widget extends WP_Widget { public function __construct() { // Create the widget options and such here, then call … Read more