จะดึงบทความภายใน theme หรือปล่าวครับ

แยกตาม cat นี้คือ ดึงรายการ cat ออกมาแล้วดึง post ที่อยู่ใน cat นั้นๆ อีกทีใช่หรือปล่าวครับ
ถ้าใช้ ก็ตามนี้อ่ะครับ
อ้างอิง
http://codex.wordpress.org/Function_Reference/get_categories
http://codex.wordpress.org/Template_Tags/get_posts 
<?php
$categories = get_categories(); // get all categories return as array
// fetch categories for get post inside
foreach($categories as $category) {
$my_posts = get_posts(array('category' => $category->cat_ID)); // return all post are contain in this category
foreach($my_posts as $post) {
setup_postdata($post);
// post content
the_title();
the_permalink();
// ...
}
}
?>