Widgets not showing in my custom theme

You’re using the widget name and not i.d which is why it isn’t working. Change this: if (is_active_sidebar( ‘My_Widgtet_Area’ ) ) : ?> <div id=”widget-sidebar”> <ul> <?php dynamic_sidebar( ‘My_Widgtet_Area’ ); ?> </ul> To this: if (is_active_sidebar( ‘partner-slide’ ) ) : ?> <div id=”widget-sidebar”> <ul> <?php dynamic_sidebar( ‘partner-slide’ ); ?> </ul> The i.d in the template … Read more

When you register a sidebar in WordPress, is it possible to choose in what order it appears in the admin

Sidebars are output in registration order, which is implicitly captured by how they are added to a $wp_registered_sidebars global. This can easily be manipulated, for example following code will move first sidebar to the start: add_action( ‘register_sidebar’, function ( $sidebar ) { global $wp_registered_sidebars; if ( ‘first’ === $sidebar[‘id’] ) { $sidebar = $wp_registered_sidebars[‘first’]; unset( … Read more

How can I add a specific, custom widget to my theme’s header.php?

The WordPress codex mentions you should call the Widget Class name. Could it be that openingTimesWidget is a function instead of a Class? Following the WP Class naming convention your class would be written like this Opening_Times_Widget. https://codex.wordpress.org/Widgets_API Another possible reason that the widget is not displaying could have to do with the way your … Read more