widgets_init actions not fired from functions.php’s child theme

In your child theme’s ‘functions.php’ file, you need to use the remove_action( ‘widgets_init’, ‘$name’ ); script. For instance, in your twentytwelve-child theme’s functions.php file, use: remove_action( ‘widgets_init’, ‘twentytwelve_widgets_init’ ); //necessary to replace parent theme’s code and then hook your new widget in your child theme’s function add_action( ‘widgets_init’, ‘new_twentytwelve_widgets_init’, 0 );

Does current page contain widget or sidebar

Sidebars aren’t assigned to pages by means of, say, database entries or any other means that PHP can detect easily. Sidebars just run where a function call tells them to run. You can’t really query to see if a sidebar is on a particular page because there is nothing to query. Well, almost nothing. The … Read more

Slider from different widgets

Found a (half)solution. Slick is very helpful. I integrated this in a template. The data now is static so that need to be changed. I created a sidebar but now I need to loop through the widgets. I think I’m trying to use this Still any ideas/thoughts are more than welcome!

How to change text of a widget depend on condition?

It should be pretty easy to alter the text for the Core text widget via the widget_text filter: function conditional_text_widget_wpse_207957($text) { if (is_single()) { $text = “Whoa, d00d! I’m single”; } return $text; } add_filter(‘widget_text’,’conditional_text_widget_wpse_207957′); You do not specify what conditions you need exactly, nor provide any detail about the changes you need.