While I waited, I managed to uncover the Excerpt field in the wordpress admin area. It was neatly hidden, but I discovered, with the help of another thorough search on the interweb.
It was located in the rolldown menu (something with screen setting) at the top right, while editing the post.
Now that I found the Excerpt field, I am able to include HTML in my Excerpt. BUT… not all went well.
It prints all the post titles correctly. But for some reason, with every post it prints, it prints the excerpt of the first post. While I had filled in the excerpt of every single post, and so it should print the excerpt of the respective posts.
Did I put some code on a place where I shouldn’t have? Of course I will try and find the solution later today, but if anyone can help finding it, it would be much appreciated!
Here’s the address again: http://www.test.muziektaal.nl
Bye!
Hi Dr. Killjoy,
Yes, there is a way to show the embed code but my solution will make shortcodes work in all WordPress Post Excerpts.
These are the steps to follow:
1) Open the functions.php file located in your WordPress theme.
2) Add the following code after the <?php line:
remove_filter(‘get_the_excerpt’, ‘wp_trim_excerpt’);
add_filter(‘get_the_excerpt’, ‘custom_trim_excerpt’);
function custom_trim_excerpt($text = ”)
{
$raw_excerpt = $text;
if ( ” == $text ) {
$text = get_the_content(”);
$excerpt_length = apply_filters(‘excerpt_length’, 55);
$excerpt_more = apply_filters(‘excerpt_more’, ‘ ‘ . ‘[…]’);
$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
}
return apply_filters(‘wp_trim_excerpt’, $text, $raw_excerpt);
}
add_filter(‘get_the_excerpt’,’do_shortcode’);
3) Save the file
It should work but if there is any other page using the WordPress function “get_the_excerpt”, the shortcode will be shown.
Hope it helps you.
Why are you writing excerpts for all your posts in the Excerpt field of each post? By default, the excerpt is shown by taking the first 55 characters of your post content. To enable the excerpts in my plugin, you have to go to the dashboard / Settings / Column Posts. Go to the Post section and check the show excerpt box.
Hi Lebasca,
Thanks for the response. I also noticed that you did an upgrade of the plugin. Actually I started by looking into what that update would bring in difference and now I noticed that it now shows the text under Excerpt with the embed code of Soundcloud! That is just so awesome!
I use Column Posts on my frontpage/homepage, where I use the Excerpt field to write little teasers that will lead people to the actual article and playlist, which doesn’t contain the text from the Excerpt field.
So it is more a summary, then an introduction. Hope I made it a bit clear 😉
Anyway, I will reward you for your work! I am much grateful!