/ Published in: PHP

This shows how to add content (in this case a linked image) to the end of a post using WordPress custom fields and the Thesis theme.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function add_custom_field() { global $post; if (get_post_meta($post->ID, 'key', true)) { ?> <a href="<?php echo get_post_meta($post->ID, 'key', true); ?>"><img src="<?php echo get_post_meta($post->ID, 'key', true); ?>" alt="description" /></a> <?php } } add_action('thesis_hook_after_post', 'add_custom_field', 1);
Comments
