I have a custom sidebar named "sidebar-events" that should only display posts in the "Events" category. I placed the following code in the sidebar. The header appears, but not the unordered list. In the source code there's nothing - no ul, no li. What am I doing wrong?
<div id="sidebar" class="widgets-area">
<h2>What's Going On</h2>
<?php
//what I will be looking for
$args = array(
"type" => post,
"posts_per_page" => 5,
"category_name" => "Events"
);
//create new query and pass the arguments
$recentEvents = new WP_Query($args);
if( $recentEvents->have_posts() ): ?>
<ul>
<?php while( $recentEvents->have_posts() ): $recentEvents->the_post(); ?>
<li><?php the_title(); ?></li>
<?php endwhile; ?>
</ul>
<?php endif; wp_reset_postdata();
?>