Where do I put this snippet I found.
-
This code snippet was marked as incomplete but I want to have this work on my WPtube3 theme I’m using with the video swiper plugin activated. The tube theme from freewptube has a thumb custom field function but the videoswiper plugin overrides the field “thumb” if created in the post.conflicting custom fields? I’m not sure why. I’m new I guess.
I thought this snippet might help but I don’t know where to put it.
or if it will work. If anyone can tell me a solution or how to use this code I would appreciate it.
<?phpfunction prefix_get_image_thumb($post_id) {
global $wpdb;
$attachment_id = $wpdb->get_var(“SELECT ID FROM $wpdb->posts WHERE post_parent = ‘$post_id’ AND post_status = ‘inherit’ AND post_type=’attachment’ ORDER BY post_date DESC LIMIT 1”);
$thumb = get_attachment_icon($attachment_id);
echo $thumb;
}
?>
- The topic ‘Where do I put this snippet I found.’ is closed to new replies.