Single Widget Multi Sidebar

I figured it out after looking at wp_option tables for my widget and the sidebars_widget option I figured out that my widget name has to be none white space separated, in my case it should be anzima_posts_widgets, also I have to include the base-id in the control_ops parameter as the first index. Another issue I … Read more

How do I stop out of stock items from appearing on my WooCommerce site when using the Layered Nav widget [closed]

// Out of stock for general woocommerce – might help someone function product_in_stock($post, $product) { if (!$product->is_in_stock()) { $STOCK = TRUE; return $STOCK; } else { return false; } } function check_if_out_of_stock(){ global $post,$product; $stock = product_in_stock($post,$product); $output=”<div class=””; $output .= $stock?”instock”:”outofstock”; $output .= ‘”>’; echo $output; } add_action( ‘woocommerce_before_shop_loop_item’, ‘check_if_out_of_stock’); function close_out_of_stock(){ echo “</div>”; … Read more

Author Link in Recent Posts Widget

I think the rather simplistic approach would be: copy the whole WP_Widget_Categories from wp-includes/default-widgets.php, and paste it to your functions.php. In there, you could modify the output by customizing this part of the class: class WP_Widget_Recent_Posts extends WP_Widget { … <?php echo $before_widget; ?> <?php if ( $title ) echo $before_title . $title . $after_title; … Read more

Show or hide a widget from pages

Barring the discovery of a plugin that does this already (I’m not aware of any that specifically do what you want) you’ll need to create your own. add_meta_box and add_filter(‘widget_display_callback’, $instance, $widget, $args) should be the bulk of what you need

WordPress Hide Widget If $_Session Is Active?

The easiest way to do this is via dynamic_sidebar() <?php if ($a == $b) // Your $_SESSION stuff dynamic_sidebar( ‘Right Sidebar’ ); ?> Any widgets contained in the “Right Sidebar” will now be loaded based on your condition. You should use this with register_sidebar() http://codex.wordpress.org/Function_Reference/dynamic_sidebar

Add New Footer Widget Area with Limited Options?

Widget areas are the wrong tools for what you need. They are built to offer a choice. Breaking that would be very difficult … and hard to understand for the user. Alternative: Use a custom setting, for example in wp-admin/options-general.php where the tagline and the site title is. There is even a hook for such … Read more

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