Undefined Variable in my widget
You need to use $instance[‘image_path’], or extract $instance (I prefer the former).
You need to use $instance[‘image_path’], or extract $instance (I prefer the former).
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
The solution for me was to install & activate the “Use Google Libraries” plugin which loads resources from Google’s CDN. I’m unsure why this is a fix, but it worked.
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
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
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
The class that extends WP_Widget must have a widget method. That is: class Dummy_Widget extends WP_Widget { /* This method is required */ function widget($args, $instance) { } }
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
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
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