![]() |
Wordpress Ninjas help please: Conditional IF statement using a custom field..
Google was no help so again I turn to the community. I have some site that I used themes on that needed to have a custom field for the thumbnail (before featured images) like this :
Code:
<?php echo get_post_meta($post->ID, thumb, true); ?> |
The Codex link for get_post_meta, get_the_post_thumbnail:
http://codex.wordpress.org/Function_.../get_post_meta http://codex.wordpress.org/Function_...post_thumbnail Something like this probably: Code:
if ( $my_thumb = get_post_meta($post->ID, 'thumb', true) ) |
UNTESTED:
Something like this might be easier to manage, add to your theme functions.php file: Code:
function get_custom_thumb( $post_id ) { Code:
<?php echo get_custom_thumb( $post->ID ); ?> |
yeppers:pimp
|
:thumbsup:thumbsup
|
Nice, I could use this too.
Thanks Brujah. :thumbsup |
All times are GMT -7. The time now is 01:57 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123