Hello,
Yes, I’m sure there’s a way to achieve what you’d like.
To get a thumbnail image linking to another post:
[field thumbnail-link name="hello-world"]
To get just the URL of another post:
<a href='[field url name="hello-world"]'>
Click here for the full post.
</a>
If the excerpt is part of the post, then you can omit the name parameter.
I hope that helps!
Thread Starter
ZacN
(@zacn)
Sorry Eliot, maybe I wasn’t clear.
I’m trying to use shortcodes in the actual manual excerpt (not in the section before the <!–more–> – I don’t use such sections).
I can easily get the links and information if I include the shortcodes in a post, but when they are in the separate “Excerpt” (hand-crafted summaries) input box, they just display on the page as shortcodes, not as links (or whatever) as interpreted by your plugin.
Can it be made to work in the manual excerpt?
Ooh, I see – so shortcodes are not executed in the manual excerpt.
How are the excerpts being displayed, is it by the theme? In that case, it may be necessary to modify it to execute shortcodes inside excerpts.
You can try adding these lines to your functions.php file:
add_filter( 'the_excerpt', 'shortcode_unautop');
add_filter( 'the_excerpt', 'do_shortcode');
This should work if the theme uses a normal method of displaying excerpts. If the excerpts are in a custom field, it’ll be necessary to find out where it’s being displayed, and change it to run shortcodes.
Thread Starter
ZacN
(@zacn)
Yes, the theme displays the excerpts. The filters did the trick.
Thank you so much!
Perfect, I’m glad that worked. 🙂