Hi
I’m using this code on content-extensions.php to display full content of some posts in home. It works on Travelify!
<?php
global $post;
if($post->post_excerpt){
the_excerpt();
}else{
the_content();
}
Now I would like to display the “Read more” button only in posts that use the_excerpt in home.
I found a tip in the codex https://codex.wordpress.org/Customizing_the_Read_More called “More about $more” that can be useful to display the “Read more” for only the first post. But I don’t know how to integrate it on my content-extensions.php. The code is:
<?php global $more; $more = -1; //declare and set $more before The Loop ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); //begin The Loop ?>
<?php
if ($more == -1) { //do not use the more tag on the first one.
the_content();
$more = 0; //prevent this from happening again. use the more tag from now on.
}
else { //use the more tag
the_content(__(‘Read more…’));
}
?>
<?php endwhile; //end of The Loop ?>
Please I need help to display the “Read more” only in posts that use the_excerpt, or since the third post onwards.