I have a post page that shows the title of the post and I want it to click on the title to open a DIV with the post itself.
I do not have Javascript issues that are required for this. My problem is that all news is being displayed, rather than just the one associated with the clicked title.
I think my problem is in the loop, but I could not resolve it.
This is my current code:
<!-- laço -->
<?php query_posts('posts_per_page=2&cat=36');?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<figure class="effect-goliath">
<img src="<?php echo wp_get_attachment_url(get_post_thumbnail_id()); ?>" alt="<?php the_title(); ?>"/>
<figcaption>
<h2><?php the_title(); ?></h2>
<p><?php wp_limit_post(39,'...',true);?>...</p>
<!-- <a href="<?php the_permalink() ?>">Veja mais</a> -->
</figcaption>
</figure>
<div class="post-single">
<span class="close">Fechar</span>
<h2><?php the_title(); ?></h2>
<p><?php the_content(); ?></p>
<span class="close">Fechar</span>
</div>
<?php endwhile?>
<?php else: ?>
<h2>Nada Encontrado</h2>
<p>Erro 404</p>
<p>Lamentamos mas não foram encontrados artigos.</p>
<?php endif; ?>
<?php wp_reset_query(); ?>
<!-- fim laço -->
The post-single div will appear when you click on the title.