I'm trying to add posts I have in the category to open via Slide Panel without going into a single post how can I do this?
The Demo Slide In Panel can be viewed below:
I tested it on my website but only the first post appears in every post that clicks.
My code:
<?php
$args = array(
'meta_key'=> 'ecpt_toparticle',
'showposts' => 5,
'category__in' => $cat
);
$sticky_query = new WP_Query( $args );
while ( $sticky_query->have_posts() ) : $sticky_query->the_post();
?>
<div class="border">
<a href="<?php the_permalink();?>" class="myimages js-cd-panel-trigger" data-panel="main">
<?php the_post_thumbnail('300x300');?>
</a>
<div class="col-10">
<div class="title"><?php the_title() ?></div>
</div>
</div>
<?php endwhile; wp_reset_postdata(); ?>
<div class="cd-panel cd-panel--from-right js-cd-panel-main">
<header class="cd-panel__header">
<h1><?php the_title() ?></h1>
<a href="" class="cd-panel__close js-cd-close">Close</a>
</header>
<div class="cd-panel__container">
<div class="cd-panel__content">
<div class="myimages">
<?php the_post_thumbnail('600x350');?>
</div>
<p><?php the_content(); ?></p>
</div> <!-- cd-panel__content -->
</div> <!-- cd-panel__container -->
</div> <!-- cd-panel -->
You will easily understand it through screenshots: