I want to show the three latest posts with the 50 first characters. And a “read more” link at the end. Like this:
My first post
Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Aenean vulputate. Read more…My second post
Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Aenean vulputate. Read more…My third post
Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Aenean vulputate. Read more…
Do I use get_posts? How do I do it?
This became my solution:
In the template:
In functions.php:
You can use this without the going to functions.php page.
Yes you use get_posts:
You could use something like “$mycontent = get_the_content()” and then manipulate it with phps substring, but honestly: DO NOT DO IT!
For your read more function WordPress has the perfectly fine more tag in the editor, which will automagically work for you, if you try something like this: