WordPress.org

Ready to get started?Download WordPress

Forums

dynamic sidebar function kills my sidebar (1 post)

  1. rugbert
    Member
    Posted 2 years ago #

    So I have a div for my sidebar called #rightColumn and in that div I set up the dynamic sidebar UL as directed in the codex guide. but when I add the PHP the entire rightColumn disappears, as does my facebook like button which isnt even in the div.

    here is what I mean:

    <div id="rightColumn">
    	<?php
    		$events = new WP_Query('category_name=events&posts_per_page=3');
    		if ($events->have_posts()) :
    		   while ($events->have_posts()) : $events->the_post();
    	?>
    			<div class="blogEntry">
    
    				<h3><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>">
    					<?php the_title(); ?></a>
    				</h3>
    			</div>
    			<?php
    		   endwhile;
    		endif;
    	?>
    
    	<ul id="sidebar">
    		<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
    	</ul>
    </div>

    that line of php in#sidebar kills the entire div and im not sure what.

    Oh yeah, my functions.php has this in it too:

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar();
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic