carlocab123
Member
Posted 1 year ago #
I want to excerpt all my posts in the homepage and /page to a number of words.
I would also like to add a "Click here" to continue text below it. Something like this:
Lorem ipsum dolor sit amet I don't knwo whats next...
Click Here to Continue >
How do I code that in php? I saw the hemingway theme did it, but I can't understand because all the code is in the funtions.php
I would really appreciate your help guys.
Thanks
One method:
<?php the_excerpt(); ?><a href="<?php the_permalink(); ?>">Click here to continue</a>
carlocab123
Member
Posted 1 year ago #
Hi Shadow,
Thank you for that but it's not the one I'm looking for.
I need a code that will automatically excerpt all my posts in the homepage and /page like what the theme hemingway did.
Thanks.
Well, if you put that code in the index.php and page.php files in your theme to replace <?php the_content(); ?>, it will be automatic.
Or do you mean you want it to automatically happen without changing anything?
carlocab123
Member
Posted 1 year ago #
I used the code you gave me above:
<?php the_excerpt(); ?><a href="<?php the_permalink(); ?>">Click here to continue</a>
Although it excerpted the posts automatically, is there a way to choose how many words will it show before the cut?
I also want to remove the '[…]' and turn it into '...'
Thanks
You may want to try Kafkaesqui's excellent plugin as an alternative.
http://guff.szub.net/2005/02/26/the_excerpt-reloaded/