I've built a template which gets posts from a category and have added this in as i want it to be password protected. It doesn't seem to work and i don't know why.
Is anyone kind enough to help me out?
<?php
if ( ! post_password_required( $post ) ) {
$temp = $wp_query; $wp_query= null;
$wp_query = new WP_Query(); $wp_query->query('cat=495' . '&paged='.$paged);
while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<div <?php post_class() ?>>
<h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<div class="entry">
<?php the_content() ?>
</div>
<br>
</div>
<?php endwhile; ?>
}else{
// we will show password form here
echo get_the_password_form();
}
?>