Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm building a custom theme. My sidebar is not being generated at all.

In functions.php, I have:

if ( function_exists('register_sidebar') ) {
    register_sidebar(array(
        'name' => 'Standard Sidebar',
        'id' => 'sidebar-1',
        'description' => 'Appears as the sidebar on standard pages',
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h2 class="widgettitle">',
        'after_title' => '</h2>',
    ));
}

In sidebar.php, I have:

<?php echo '<div>You made it into the sidebar function</div>'; ?>
<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
    <div id="sidebar" class="widget-area" role="complementary">
        <?php dynamic_sidebar( 'sidebar-1' ); ?>
    </div><!-- #sidebar -->
<?php endif; ?>

In page.php, I have:

<?php
/**
 * Page
 */

get_header();

?>
<?php while ( have_posts() ) : the_post(); ?>

<div class="breadcrumbs_container">
    <div class="breadcrumbs">
        <?php if ( function_exists('yoast_breadcrumb') ) {
            yoast_breadcrumb('<p id="breadcrumbs">','</p>');
        } ?>
    </div>
<div>

<div class="container">
    <div class="content_container">
        <div class="page">
            <h1><?php the_title(); ?></h1>
            <div class="content">
                <?php the_content(); ?>
            </div>
        </div>
        <?php get_sidebar; ?>
    </div>
</div>

<?php endwhile; ?>

<?php get_footer(); ?>

I don't see "You made it into the sidebar function", and nothing appears in the source code of the page I am displaying.

It is a normal Wordpress page, and I have no custom templates created yet, so it should be using page.php.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Your get_sidebar call:

<?php get_sidebar; ?>

is missing the parentheses:

<?php get_sidebar(); ?>
share|improve this answer
    
Thank you Milo! –  Steve Dec 24 '12 at 6:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.