Bhagwat Singh

PHP Developer Portfolio

Show Posts Order By Date in a Category Page


if(is_category()){
$category = get_the_category();
$category_id = $category[0]->term_id;
//$category_id = get_cat_ID($category->cat_ID);
$args = array(
'cat' => $category_id,
'orderby' => 'post_date',
'order' => 'ASC'
);
query_posts( $args );
}

This entry was posted in Wordpress. Bookmark the permalink.

Site Nevigation