ต้องการโค๊ดที่ Query ข้อมูลจาก Cat ที่เราเลือกของ Wordpress ออกมาแสดง โดยจะดึง (link)Title(link) Post Thumbnail แค่นี้ครับมาแสดงในหน้าแรก
<?php
$args = array(
'category_name' => 'your category name',
'posts_per_page' => 5
);
$query = new WP_Query($args);
?>
<?php while($query->have_posts()) : $query->the_post(); ?>
<a href="<?php the_permalink();?>">
<h1 class="title"><?php the_title(); ?></h1>
</a>
<?php the_post_thumbnail(); ?>
<?php endwhile; ?>