I want to change functionality of read more button in archive page and make it expand post content and hide excerpt whenn click on it I am using jquery to do this but when you click on button , all excerpts in page are hidden i need to hide the excerpt only in the article where the button is located any help to do this My code :
<div class="page-content">
<?php
while ( have_posts() ) {
the_post();
$post_link = get_permalink();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if ( has_post_thumbnail() ) :
the_post_thumbnail();
endif;
?>
<div class="article-content">
<header class="entry-header">
<h3 class="entry-title"><?php the_title(); ?></h3>
</header>
<div class="entry-excerpt">
<?php the_excerpt(); ?>
</div>
<div class="news-content"><?php the_content(); ?></div>
<div class="read-more-div"><a class="read-more-btn" href='javascript:read_fun()'> Read more + </a></div>
</div>
</article>
<?php } ?>
</div>
My Jquery code
jQuery(document).ready(function($) {
$('.read-more-div').click(function() {
var $toggle = $(this);
$('.entry-excerpt').hide();
$('.news-content').show();
$(this).remove();
});
});