Hi Anthoooo,
The excerpt is not really part of the list, not even the extended view.
I can add a filter so you could add the excerpt yourself with custom PHP code.
About the extended view, can you share the page where you have a list of related posts?
And the related posts do have featured images, right?
Hi,
In version 3.1.3 the excerpt should be possible:
function my_related_excerpt( $post_output, $post ) {
$excerpt = $post->post_excerpt;
$old = '</li>';
$new = '<span class="related_excerpt">'
. $excerpt . '
</span>
</li>';
$post_output = str_replace( $old, $new, $post_output );
return $post_output;
}
add_filter( 'related_show_post', 'my_related_excerpt', 10, 2 );
Please be carefull with this, just running get_the_excert() might already cause an endless loop, if related posts are being added endlessly.
It also needs some CSS to be shown nicely.
Hi,
Is there also an option to add custom fields to the Related-plugin?
We’d like to use the related posts to redirect to courses. The courses are added in a custom post type, so the related posts would work perfectly fine and in an easy way. We’d just like to add some more information.
This is basically what we would like: 2 related posts next to each other per post, which we manually select, that show:
– featured image
– Title
– Custom field: reading time
– Excerpt
– Custom field: Button to extern link
(featured image and title can still link to the page of the course).
Thanks!
Hi,
That is not built into the plugin. It is in the end just a simple related posts plugin.
It should be possible with the code above as a starting point.
If you cannot do that yourself, you might want to find a developer doing that work for you.
If you feel comfortable with me doing that for a small fee, you can email me at [email protected]