Forums

Where do I put this snippet I found. (4 posts)

  1. moonfu
    Member
    Posted 2 years ago #

    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.
    <?php

    function 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;

    }

    ?>

  2. moonfu
    Member
    Posted 2 years ago #

    Any ideas? I'm just needing a simple answer so I can try it out.

    If it's to vague of a post just let me know.

    thanks

  3. moonfu
    Member
    Posted 2 years ago #

    Is this thing on?

  4. lokrin2000
    Member
    Posted 2 years ago #

    Yes. Yes it is.

    This is a forum. It is not an Instant Messenger. You may have to wait a day or two for an answer.

    I'm not good at php and I don't know your theme so I can't help.

    I find it easiest to subscribe to rss feeds here so I can see when people post answers to my questions.

Topic Closed

This topic has been closed to new replies.

About this Topic