0

I'm using the excerpt for post but when I click on the read more link it does not show me all post paragraph and it show me only the paragraph excerpted and this the code line index.php

<?php if ( have_posts() ) : ?>
  <?php while ( have_posts() ) : the_post(); ?>
    <?php get_template_part( 'content', get_post_format() ); ?>
      <h2><a href=" <?php the_permalink(); ?> "> <?php the_title(); ?> </a></h2>
    <?php the_excerpt(); ?>
  <?php endwhile; ?>
<?php else : ?>
  <?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>

and this is the code in function.php file

function new_excerpt_more( $more ) {
  return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' .__('Read More', 'your-text-domain') . '</a>';
} 
add_filter( 'excerpt_more', 'new_excerpt_more' );
1
  • 1
    What are the other templates you have ? what does content-{post-format}.php contain? Do you have single.php
    – bravokeyl
    Apr 25 '15 at 2:26
1

WordPress uses index.php to display your Blog Page or Archives page and hence they will always call for excerpt.(Unless it is modified otherwise).
Now, single post or articles will be calling the content-function displaying the full content.Follow the below steps :-
Step 1 :- Open your single.php and check for

<?php the_excerpt(); ?>

Step 2 :- Replace above code with :-

<?php the_content(); ?>

This will change single posts to show all content in your case.If you have content-{post-format}.php then you will need to change them too.Hope this helps. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.