loop

<?php

// The Query
$the_query = new WP_Query( $args );

$the_query = array (
'post_type' => 'post',
'order' => 'ASC'
);

// The Loop
if ( $the_query->have_posts() ) {
echo '<ul>';
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo '<li>' . get_the_title() . '</li>';
}
echo '</ul>';
} else {
// no posts found
}
/* Restore original Post Data */
wp_reset_postdata();

?>

משתנה מסוג רשימה

סוג הלופ מסוג פוסטים

אם במשתנה קיימים פוסטים מדפיסים רשימה, מדפיסים את הכותרת של כל פוסט