How do I add a class to all sidebars to let a Google Custom Search Engine know not to index the content?

If you want to add a class before each widget you should use the dynamic_sidebar_params filter. Another post explains this well. Here’s the gist of it. function uft_add_nocontent_class($params) { $params[0][‘before_widget’] = ‘<aside id=”%1$s” class=”widget %2$s nocontent”>’; return $params; } add_filter(‘dynamic_sidebar_params’, ‘uft_add_nocontent_class’); Otherwise, go and edit your child theme files. If you don’t have a lot … Read more

register_sidebar / dynamic_sidebar with sidebar id

Your code works when I test it. I can only assume that the registration code is being hooked into the system too early or too late. register_sidebar() should be hooked on widgets_init per the Codex. Therefore: function register_header_sidebar_wpse_190618() { register_sidebar( array( ‘id’ => ‘header-sidebar’, ‘name’ => ‘Header’, ‘before_widget’ => ‘<div class=”widget”>’, ‘after_widget’ => ‘</div>’, ‘before_title’ … Read more

WordPress Bootstrap Grid

In my opinion, you should use wp-query. Using a sidebar for this purpose will yield problems in the long term. SEO: Sidebars are taken as “aside” content, which is considered less relevant content by search engines. Editor: The editors for the sidebars are much worse than post editors. Reliability: Any change to containers added in … Read more