Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3937

    Hi , I need to add a random post in the end of each post ..

    but I don’t know how can extra the image (name , url )

    <?php $my_query = query_posts(array(‘post_per_page’=>’6′,’orderby’=>’rand’)); ?>

    <?php

    while ( have_posts() ) : the_post();?>

    <?php

    the_title();

    // here I need the image but I want the hight (200px) and the width (150px) .. I don’t want using kriesi_post_thumb

    ?>

    <?php

    endwhile;

    // Reset Query

    wp_reset_query(); ?>

    #44242

    a:6:{s:5:”width”;s:4:”1349″;s:6:”height”;s:4:”1992″;s:14:”hwstring_small”;s:22:”height=’96’ width=’65′”;s:4:”file”;s:21:”2010/12/image-jpg.jpg”;s:5:”sizes”;a:6:{s:9:”thumbnail”;a:3:{s:4:”file”;s:21:”image-jpg-150×150.jpg”;s:5:”width”;s:3:”150″;s:6:”height”;s:3:”150″;}s:6:”medium”;a:3:{s:4:”file”;s:21:”image-jpg-203×300.jpg”;s:5:”width”;s:3:”203″;s:6:”height”;s:3:”300″;}s:5:”large”;a:3:{s:4:”file”;s:21:”image-jpg-600×500.jpg”;s:5:”width”;s:3:”600″;s:6:”height”;s:3:”500″;}s:12:”feature-post”;a:3:{s:4:”file”;s:21:”image-jpg-598×229.jpg”;s:5:”width”;s:3:”598″;s:6:”height”;s:3:”229″;}s:14:”thumbnail-post”;a:3:{s:4:”file”;s:19:”image-jpg-58×54.jpg”;s:5:”width”;s:2:”58″;s:6:”height”;s:2:”54″;}s:12:”tooltip-post”;a:3:{s:4:”file”;s:21:”image-jpg-500×250.jpg”;s:5:”width”;s:3:”500″;s:6:”height”;s:3:”250″;}}s:10:”image_meta”;a:10:{s:8:”aperture”;s:1:”0″;s:6:”credit”;s:0:””;s:6:”camera”;s:0:””;s:7:”caption”;s:0:””;s:17:”created_timestamp”;s:1:”0″;s:9:”copyright”;s:0:””;s:12:”focal_length”;s:1:”0″;s:3:”iso”;s:1:”0″;s:13:”shutter_speed”;s:1:”0″;s:5:”title”;s:0:””;}}

    #44243

    Hey,

    I’m not sure where you get your images from but if they’re attached to the post/page you can use the get_attachment_image function: http://codex.wordpress.org/Function_Reference/wp_get_attachment_image or have a look at this tutorial: http://www.elliotcondon.com/wordpress/get-attached-images-from-a-wordpress-post-or-page/

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘how can extra date of thumb (post) ..’ is closed to new replies.