Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter sqlbytemladen

    (@sqlbytemladen)

    This is the code from the mentioned timthumb plugin:
    <?php if ( get_post_meta($post->ID,'image', true) ) { ?>
    And this is yours:

    <?php
    $images = get_children(
    array(
    	'post_parent' => $post->ID,
    	'post_status' => 'inherit',
    	'post_type' => 'attachment',
    	'post_mime_type' => 'image',
    	'order' => 'ASC',
    	'orderby' => 'menu_order'
    	)
    );
    
    if ( $images ) {
    $count = 1;
    foreach ( $images as $id => $image ) {
    	if( $count === 1 ) {
    		$img = wp_get_attachment_thumb_url( $image->ID );
    		$link = get_permalink( $post->ID );
    		print "\n\n" . '<div><a href="' . $link . '"><img src="' . $img . '" alt="" /></div>';
    	}
    	$count++;
    }
    }
    ?>

    If i delete that timthumb code, it gaves me an error, and if i change image to image2 it doesn’t work.
    But if i leave everything like it is, it try to display image from timthumb (give broken image), and then display image.
    So.. i don’t know how to fix it 😐

    Thread Starter sqlbytemladen

    (@sqlbytemladen)

    mfields your the man ! 🙂 I used the link you provided on other thread.
    It displays image that i state in custom field, can you please just tell me what part should in your code so that it displays images from custom field with name image2 because image is already used for that timthumb plugin.

    Again thanks, you helped me a lot.

Viewing 2 replies - 1 through 2 (of 2 total)