WordPress.org

Support

Support » Themes and Templates » 3 special tiles to show recent posts automatically

3 special tiles to show recent posts automatically

  • Komeyl94
    Participant

    @komeyl94

    Hi
    I have 3 tiles up on my home page that shows a picture, the date and title of a post, and I want to show 3 most recent post in them. I tried using <?php query_posts("post_per_page=1"); the_post(); ?> tag on each of them and reset the query using <?php wp_reset_query(); ?> at the end of each tile’s code, but all of the tiles shows the one recent post, I mean they show the same thing.
    Plus, I’m using custom fields to store the path of image for each post, but it doesn’t work either, I use this code for the image src:<?php echo get_post_meta($post->ID, 'post_image', true) ?>
    `PLEASE help me with these

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi
    Forum Moderator

    @esmi

    What theme are you using? Where did you download it from?

    Komeyl94
    Participant

    @komeyl94

    It’s my own theme, I want to convert my own design into wordpress but I don’t have any experience on it, cause this is my first wp project.

    esmi
    Forum Moderator

    @esmi

    If you want to show three posts, try using query_posts("post_per_page=3"). Also, if this is not the main query/Loop, you should be using WP_Query() – not query_posts().

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘3 special tiles to show recent posts automatically’ is closed to new replies.