How to change color of registered widget areas in admin?

If you intend to style the sidebar in the backend, you do not need to do anything else. when you use the code you posted, the html created by WordPress for the sidebar contain a div with the id attribute equal to the id of the sidebar. Consider this code: function custom_colored_sidebar() { register_sidebar( array( … Read more

Show Woocommerce Product “attributes/extra information tab” in widget [closed]

Checkout the content-single-product.php WooCommerce template for an idea of what functions are hooked where. It is very well commented. The following should remove the additional info from the tabs: add_filter( ‘woocommerce_product_tabs’, ‘wpa_116999_remove_info’ ); function wpa_116999_remove_info( $tabs ){ unset($tabs[‘additional_information’]); return $tabs; } And then wherever you’d like to add the Additional Info you’ll just need to … Read more

How to pass a special CSS class into widget li

function widget_display_callback( $params ) { global $wp_registered_widgets; global $my_widget_num; // Global a counter array $id = $params[0][‘widget_id’]; $sidebar_id = $params[0][‘id’]; /* Set some count for each widgets */ if( !$my_widget_num ) { // If the counter array doesn’t exist, create it $my_widget_num = array(); } if( isset( $my_widget_num[ $sidebar_id ] ) ) { // See … Read more

How to use wordpress content class?

If I understood you correctly, this is what you are trying to achieve: register_sidebar(array( ‘name’ => ‘Sidebar Name’, ‘id’ => ‘sidebar-id’, ‘before_widget’ => ‘<div class=”sidebar_area”>’, ‘before_title’ => ‘<h4>’, ‘after_title’ => ‘</h4><div class=”sidebar_content”>’, ‘after_widget’ => ‘</div></div>’, )); References: register_sidebar

wp_dropdown_pages in widget form

I have no idea why but changing the update function to the following seemed to do the trick: public function update( $new_instance, $old_instance ) { $instance = $old_instance; if( isset( $new_instance[‘page_id’] ) ) { if( $new_instance == ” ) { $instance[‘page_id’] = ”; } else if ( (int) $new_instance[‘page_id’] > 0 ) { $instance[‘page_id’] = … Read more

‘is_author()’ logic in widget for author only

is_author() is only for Archive pages. Quote from the Codex: is_author() checks if an Author archive page is being displayed So viewing a single Post or Page isn’t going to get a TRUE from is_author(). I think you’ll want something more like this: global $post,$current_user; // get the global variables to check get_currentuserinfo(); // get … Read more

How to get options of all active widgets ?

This actually seems like a quite plausible approach – to me. There is nothing wrong with looping through it, sometimes it is the only/fastest way anyway. I don’t know how you get your sidebars, but for this $sidebars_widgets = get_option( ‘sidebars_widgets’ ); can be used. Which gives you an associative array containing a list of … Read more

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