Need related post short code to display images from custom fields - Wordpress Solution
[Solved] - Need related post short code to display images from custom fields - Wordpress Solution |
---|
Try following codes |
Hi
I found the code that allows a current blog post to show related posts based on it's tags:
http://blue-anvil.com/archives/8-fun-useful-shortcode-functions-for-wordpress/
It works great however instead of a bulleted list with the titles I would like it to display just the thumbnails related to the post (which are pulled in via a custom field in each of these tagged posts)
Can anybody help me?
Thanks
Steve
Solution - 1I assume you meant to #4 on that page - " Show related posts (uses tags)" Paste this code instead, I added it inside: '; return $retval; } return; } add_shortcode('related_posts', 'related_posts_shortcode'); Notice the line - If your custom field key is $image for example, you will write - $image instead of - $your_custom_field_name_here Another thing, add to the bottom of youestyle.css that inside your template folder this code: or just -
|
Date: 2022-10-21 05:20:10 |
Category: Wordpress |