Make posts appear ASC but with custom coding.
-
Hello guys, i’m in need of your precious help!
I have many categories that shows posts.
The query code is modified so that the category will only show posts that belong in the currently viewed category and NOT in its child subcategories.So far, the code works well.
My question is, what do i have to add in order to show posts ascendingly? This is the code:
<?php $subcategories = get_categories(array('type' => 'post', 'child_of' => $_GET['cat'])); foreach ($subcategories as $i => $value) { $excluded_cats .= ",-".$value->cat_ID; } if (!empty($excluded_cats)) { $MainLoopArgs = array('cat' => $_GET['cat'] . $excluded_cats); } else { $MainLoopArgs = array('cat' => $_GET['cat']); } query_posts( $MainLoopArgs ); while ( have_posts() ) : the_post(); ?>
I thought by adding a:
query_posts( $MainLoopArgs . '&order=ASC' );
would work.. but it doesn’t.
Anyone can help me?
Thanks in advance ??
[No bumping. If it’s that urgent, consider hiring someone.]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Make posts appear ASC but with custom coding.’ is closed to new replies.