WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Need help for echo (php)

[Resolved] Need help for echo (php)

  • Hey guys i wantto echo the size of height and width i am not sure how to print like alt plzhelpi have placed my function for image below

    # Displays post image attachment (sizes: thumbnail, medium, full)
    function dp_attachment_image($postid=0, $size='thumbnail', $attributes='') {
    	if ($postid<1) $postid = get_the_ID();
    	if ($images = get_children(array(
    		'post_parent' => $postid,
    		'post_type' => 'attachment',
    		'numberposts' => 1,
    		'post_mime_type' => 'image',)))
    		foreach($images as $image) {
    			$attachment=wp_get_attachment_image_src($image->ID, $size);
    			?><img src="<?php echo $attachment[0]; ?>" <?php echo $attributes; ?> /><?php
    		}
    }
  • The topic ‘[Resolved] Need help for echo (php)’ is closed to new replies.
Skip to toolbar