Tags Instead of Category

I think your idea is really nice here, but you have a couple of serious flaws in your code. Never use extract(), ever. It is extremely hard to debug and can render unexpected output. It has now been completely removed from core, except in one instance as far as I can pick up from this … Read more

Check if widget is inside sidebar with PHP

You should make the check inside the widget class, unless you don’t have a choice. The example in the codex is pretty much what you’re looking for: class cbs_map_widget extends WP_Widget{ function cbs_map_widget(){ $this->WP_Widget(‘cbsmaps’, __(‘Widget Name’), array(‘classname’ => ‘cbsmaps’, ‘description’ => __(‘whatever’))); … add_action(‘wp_enqueue_scripts’, array(&$this, ‘js’)); } function js(){ if ( is_active_widget(false, false, $this->id_base, true) … Read more

Output column number according to active sidebars

Use the array_filter() function, which will remove every array element that has false as the value. Then you can count the array length. So your example would look like this: $sidebars = array( is_active_sidebar( ‘footer-4’ ), is_active_sidebar( ‘footer-3’ ), is_active_sidebar( ‘footer-2’ ), is_active_sidebar( ‘footer-1’ ), ); $active_sidebars = array_filter($sidebars); echo ‘col-‘.count($active_sidebars);

Can’t replace the default sidebar with a custom sidebar on Custom Post Type in Genesis

I have this post and the response from David Chu to thank for enlightening me. There is nothing patently ‘wrong’ with the way that I implemented this. The reason that it doesn’t work is because of the fact that I have both the Genesis Simple Sidebars plugin and the Genesis Woocommerce Connect plugin installed. Both … Read more

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