WordPress.org

Ready to get started?Download WordPress

Forums

post_thumbnail producing wp-includes/images/crystal/default.png (6 posts)

  1. helgatheviking
    Member
    Posted 3 years ago #

    i'm using timthumb in correlation with the post_thumbnail functionality of wordpress. i've had a ton of issues w/ timthumb, but i have those sorted and now the problem lies in the image source file that I am passing to timthumb.

    i've got a large function that runs through a bunch of places to try to find a thumbnail for the particular post... starting w/ checking to see if the post has_post_thumbnail()

    but i've got a post that does NOT have a post thumbnail and is still triggering this part of the code. it is then spitting out the src of this fake thumbnail as :

    http://testtrack.benfrain.com/wp-includes/images/crystal/default.png

    here is the beginning part of my code:

    if ( has_post_thumbnail() ) {
    		$image_id = get_post_thumbnail_id();
    		$image_url = wp_get_attachment_image_src($image_id,$size, true);
    		$img_src = $image_url[0]; 
    
    		$img_alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
    
    		if(!count($img_alt)) {$img_alt= $post->post_title;} else { $img_alt = $post->post_title . ' thumbnail'; }
    
    		$debug = 'post_thumb';
    }

    later on where i use timthumb to generate the image- i echo out the $debug just to know which part of my code is producing the thumb- which is why i am convinced that my if(has_post_thumbnail()) is triggering true, even though my post doesn't have a thumbnail. even if i thought that my wp_get_attachment_image_src bits were doing weird things, w/o a thumbnail it shouldn't even be executing that code right?

  2. alchymyth
    Forum Moderator
    Posted 3 years ago #

    what code is doing the output of the div .homePlayerWrapper ?

    and particularly, the output of the div .scrollWrapper ?

  3. helgatheviking
    Member
    Posted 3 years ago #

    do you think i might be closing some tags improperly? well there is quite a bit of code. this is a child theme built on the Thematic framework so i have lots of functions being placed on different action hooks.

    specifically, i've only worked on the category and single pages...

    so this:
    http://testtrack.benfrain.com/channels/stuff/flat-out-action/

    would be better than looking at the home page.

    here's my markup for the main video, and the 2 rows of smaller thumbs

    [code moderated as per forum rules - please use the pastebin]

    http://pastebin.com/zQ6RNrpd

  4. helgatheviking
    Member
    Posted 3 years ago #

    and just b/c that post was getting out of control (and when i help other people i get overwhelmed w/ huge blocks of code) i'll post my image getting function in this post:

    [code moderated as per forum rules - please use the pastebin]

    http://pastebin.com/XhLT622s

    it is an amalgamation of a lot of different sources, but i am aiming for it to be very determined to find something usable as a thumb.

  5. alchymyth
    Forum Moderator
    Posted 3 years ago #

    it should have warned you about the pastebin ;-)

    you thumbcode seems to be using the kia_image(100,100) function;

    in line98 (in the second pastebin) it sets the default image if anything else failed:

    if(empty($img_src)){
                    $img_src = IMAGES . 'default-thumb.png';
                    $img_alt= $post->post_title . ' thumbnail';
                    $debug = 'default';
    }

    i don't see any easy option to avoid the output of some default image.

  6. helgatheviking
    Member
    Posted 3 years ago #

    except that echoing out the $debug character is giving me the value that is set during the if(has_post_thumb()){} section ??

    also- a default image is fine, but IMAGES is a constant I have defined the should point to my theme's image folder and not the wp-includes folder. but will double check (though i've used that constant elsewhere w/ no problems)

Topic Closed

This topic has been closed to new replies.

About this Topic