Randomizing the RSS Widget

Here’s one way to achieve this: /** * Display a random feed in the RSS Widget * Activated by the wpse_random_url string in the feed url * * @see http://wordpress.stackexchange.com/a/187599/26350 */ ! is_admin() && add_filter( ‘wp_feed_options’, function( $feed, $url ) { // Modify this list of feeds to your needs: $urls = [ ‘http://stackoverflow.com/feeds/’, ‘http://wordpress.stackexchange.com/feeds’, … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)