Sidebar and main content won’t load at same time (custom theme)
-
I’m sure i’m just missing something in the code, it’s my first time trying to use a sidebar. Either the sidebar or main content load, but never at the same time (depending on how i change my code). Most of the time it’s the sidebar that doesn’t load. URL is https://match.onesquad.nl/
index.php:
<?php get_header(); ?> <?php get_sidebar(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php get_footer(); ?>
sidebar.php:
<?php if ( ! is_active_sidebar( 'sidebar-1' ) ) { return; }?> <div id="secondary" class="widget-area" role="complementary"> <?php dynamic_sidebar( 'sidebar-1' ); ?> </div>
functions.php:
<?php function arphabet_widgets_init() { register_sidebar( array( 'name' => 'sidebar-1', 'id' => 'sidebar-1', 'before_widget' => '<div>', 'after_widget' => '</div>', 'before_title' => '<h2 class="rounded">', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'arphabet_widgets_init' ); ?>
Any suggestions? Many thanks.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Sidebar and main content won’t load at same time (custom theme)’ is closed to new replies.