WordPress.org

Forums

permalink in query (1 post)

  1. bjornesjo
    Member
    Posted 2 years ago #

    how do I add links to the post in the loop?

    <?php
    
    // The Query
    $the_query = new WP_Query( 'category_name=Pizza' );
    
    // The Loop
    while ( $the_query->have_posts() ) : $the_query->the_post();
    	echo '<li>';
    	echo the_title();
    	echo '<br>';
    	echo the_post_thumbnail('thumbnail');
    	echo '</li>';
    endwhile;
    
    // Reset Post Data
    wp_reset_postdata();
    
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic