How to use and style the excerpt
I want to show good stylized previews of the posts on the home page without using featured images.
One way is use excerpts with a Visual Editor (TinyMCE editor) to stylize the excerpts.
An example before I stylize the preview.
To see the TinyMCE visual editor in your excerpts.
Add the following code your child theme functions.php file or custom plugin.
The second code. Forces the read me to be added to the bottom of the post preview excerpt.
NB!
In your posts editor screen. Remember to turn on the Excerpts box by going to Screen Options top right, and turn on excerpts so you can see it below your post content area.
I went to one of the posts I made. Copied some of the text from the post content area and pasted it into the excerpt area. (Btw the screenshots are from the Norwegian Sustainable Society web site okosamfunn.no)
The post preview that also includes a read more (in Norwegian it is Les Mer).
Btw.
Since I am using Genesis I also needed to go to Genesis -> Theme Settings and change Content Archives to Display post excerpts. To have the archives (blog page) show the excerpts I made. Here I could also include the featured image if I choose to do so.
Adding an excerpt to a page
Add the following code snippet to your functions.php file to enable excerpt on pages:
function add_excerpts_to_pages() {
add_post_type_support('page', 'excerpt');
}
add_action('init', 'add_excerpts_to_pages');
A helpful plugin:
Advanced Excerpt WordPress Plugin
Two other plugins:
Easy custom auto excerpt WordPress plugin
Rich text excerpts WordPress plugin
thank you ! that code was superb ! i was trying sevral solutions and yours war the only one who worked (with wordpress 4.22)
cheers