Get Post title, Postdate, Tag, and thumbnail PHP ? (help)
-
Hello !
I’am trying to parse the last 4 posts data and show them in a box-div of 300 x 300 px.
I need to put in :
– A small thumbnail of 300px width and 100 height.
– The Title
– The date of the post
– 2/3 TagsActually this is my php code, it’s working for the title and date but i’am stuck about grabbing the thumbnail
<?php $args=array( 'post_type'=> 'post', 'post_status' => 'publish', 'posts_per_page' => 1, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { echo ''; while ($my_query->have_posts()) : $my_query->the_post(); ?> <li><a href="<?php the_permalink() ?> title=" <?php the_title_attribute(); ?>"><?php the_title(); ?></a> <?php the_time( 'd.m.y') ?> <?php echo get_the_post_thumbnail( $page->ID, 'thumbnail' ); ?> </li> <?php endwhile; } ?>
The topic ‘Get Post title, Postdate, Tag, and thumbnail PHP ? (help)’ is closed to new replies.