• Hi there!

    I want to have a page on my blog that displays all posts under one tag (just the title and images). I would like for that page to be my front page. It just looks like a collage of photos under a sentence.

    Is there any way of doing this?

    Many thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi CharlotteBarber,

    Try to put this code where do you want to display the post

    query_posts( 'tag=yourtag' );
    while ( have_posts() ) : the_post();
         the_title();
        if ( has_post_thumbnail() ) {
    	the_post_thumbnail();
         }
    endwhile;
    
    wp_reset_query();

    Try this!

    Thread Starter CharlotteBarber

    (@charlottebarber)

    Thank you so much!! Where do I put my things in to make it show up? It seems to be showing code at the moment. I’ve replaced your tag with ‘easy’ but what else do I have to do? Many thanks

    Hi CharlotteBarber,

    Since this code is php
    Please don’t forget to put <?php at the beggining and ?> at the end. So the code will be

    <?php
    
    query_posts( 'tag=yourtag' );
    while ( have_posts() ) : the_post();
         the_title();
        if ( has_post_thumbnail() ) {
    	the_post_thumbnail();
         }
    endwhile;
    
    wp_reset_query();
    ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Displaying a page by tags’ is closed to new replies.