Are there any official or unofficial guidelines for the styling of a widget?

A theme has near complete control over the appearance of a site, including the widgets. And any plugin could load a stylesheet that overrides elements of your, intentionally or not. There are guidelines to encourage certain standards of code quality, which are enforced to some degree if the plugin/theme is hosted on the WordPress.org plugin … Read more

How to best include widget area just on homepage?

Is this expected behaviour? Yes, it is expected behavior. The genesis_register_sidebar() function is just a call to register_sidebar() with a few predefined defaults for $args and a filter named ‘genesis_register_sidebar_defaults’: function genesis_register_sidebar( $args ) { $defaults = (array) apply_filters( ‘genesis_register_sidebar_defaults’, array( ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”><div class=”widget-wrap”>’, ‘after_widget’ => “</div></div>\n”, ‘before_title’ => ‘<h4 class=”widgettitle”>’, … Read more

How to use get_results() in widget front end?

It seems that you can’t access to it. Please try add global $wpdb; to your function. UPDATE For reference, in WordPress Codex you will find: WordPress provides a global variable, $wpdb, which is an instantiation of the class already set up to talk to the WordPress database. Always use the global $wpdb variable. (Remember to … Read more

How to use the widget area to extend the page content?

Hook into register_sidebar and remove the sidebar from the global array $wp_registered_sidebars: add_action( ‘register_sidebar’, function( $sidebar ) { if ( ‘lateral’ === $sidebar[ ‘name’ ] ) unset( $GLOBALS[‘wp_registered_sidebars’][ $sidebar[ ‘id’ ] ] ); }); Then adjust the stylesheet or add extra CSS to wp_head to let the page content take the full width. See also: … Read more

Widget title markup in register_sidebar

If that is all of your “title” code, you aren’t echoing $before_title and $after_title. Look at how the default text widget, which you reference, does it: 399 function widget( $args, $instance ) { 400 extract($args); 401 $title = apply_filters( ‘widget_title’, empty( $instance[‘title’] ) ? ” : $instance[‘title’], $instance, $this->id_base ); 402 $text = apply_filters( ‘widget_text’, … Read more

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