Always show the widget title in a wordpress widget

That is not native behavior of it. If you check the source of WP_Widget_Categories $title = apply_filters( ‘widget_title’, empty( $instance[‘title’] ) ? __( ‘Categories’ ) : $instance[‘title’], $instance, $this->id_base ); The title comes exclusively from the value saved in instance (or default if not). There is no logic to tie it in with current context. … Read more

wp_list_categories + widget

Your widget must have a method that looks something like this: public function widget( $args, $instance ) { echo $args[‘before_widget’]; if ( ! empty( $instance[‘title’] ) ) { echo $args[‘before_title’] . apply_filters( ‘widget_title’, $instance[‘title’] ). $args[‘after_title’]; } wp_list_categories(); echo $args[‘after_widget’]; } Apply your filter inside that method, then remove it: public function widget( $args, $instance … Read more

Active Sidebar Conditional Question?

If I am reading this right, all you need is a count of the active sidebars, so: $col = 0; if(is_active_sidebar(‘footer’)) { $col++; } if(is_active_sidebar(‘footer-2’)) { $col++; } if( is_active_sidebar(‘footer-3’)) { $col++; }?> <div class=”<?php echo ‘column-‘.$col; ?>”> Note: I flipped the “column” class so that it begins with a letter. Numbers are not allowed … Read more

How to make featured area?

You need an update method which saves your widget settings: function update( $new_instance, $instance ) { for ( $i=0; $i < 3; $i++ ) $instance[ “link_target_$i” ] = $new_instance[ “link_target_$i” ]; return $instance; }