Title: conditional array
Last modified: August 21, 2016

---

# conditional array

 *  [srdrkrm](https://wordpress.org/support/users/srdrkrm/)
 * (@srdrkrm)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/conditional-array/)
 * Hey folk,
 *  I have a template that visualizes posts in a certain category in a certain way.
   It calls em up via:
 *     ```
       <?php
       	$args = array(
       		 'order' => 'ASC',
       		 'category_name' => 'blog',
       		 'post_type' => 'post',
       		 'posts_per_page' => 16,
       		 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1)
       		 );
   
       	query_posts($args);
       ```
   
 * What I would like is for that same visualization to take place for posts under
   a different category as well, but also in DESC order as opposed to ASC. So basically
   the functionality I’m looking for is
    If category name is blog, show blog posts
   in ASC order OR If category name is (say) announcements, show posts categorized
   as “announcements” in DESC order.
 * What do you folk think? Sorry to come here – I feel like I’m not really understanding
   the Codex too well, and I’m very new at this stuff.
 * For reference, the theme I’m using is Slider Responsive by DESSIGN ([link](http://www.dessign.net/slider-responsive-theme-free-2013/)).
   The specific php is tpl-blog.php. Thanks everyone!

The topic ‘conditional array’ is closed to new replies.

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 0 replies
 * 1 participant
 * Last reply from: [srdrkrm](https://wordpress.org/support/users/srdrkrm/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/conditional-array/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
