Skip to content

Instantly share code, notes, and snippets.

@itcomindo
Created June 11, 2022 10:00
Show Gist options
  • Save itcomindo/123ebd9c4bd6fe916152507ba9280ec5 to your computer and use it in GitHub Desktop.
Save itcomindo/123ebd9c4bd6fe916152507ba9280ec5 to your computer and use it in GitHub Desktop.
basic_wp_query
<div class="prq">
<?php
# ARGUMEN START
$args = array (
'post_type' => 'post',
'posts_per_page' => 5,
'order' => 'ASC'
);
#QUERY START
$query = new WP_Query($args);
#QUERY MEET
while($query->have_posts()) : $query->the_post();
?>
<!-- DISPLAY START -->
<div class="itemq">
<h5><?php the_title(); ?></h5>
</div>
<?php endwhile; wp_reset_query(); ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment