Title: Shortcode only partially working
Last modified: February 7, 2018

---

# Shortcode only partially working

 *  Resolved [Pirate Tayls](https://wordpress.org/support/users/pirate-tayls/)
 * (@pirate-tayls)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/shortcode-only-partially-working/)
 * Using this shortcode for the new products section.
 * [products limit=”6″ columns=”2″ orderby=”id” order=”DESC”]
 * With the new update (3.3.1), I cannot get the orderby to work correctly. It list
   items by SKU number. I can change the limit, I can add a category, those both
   work fine.
 * But orderby doesn’t seem to work, not with id or date.
 * Any help would be appreciated.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fshortcode-only-partially-working%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Caleb Burks](https://wordpress.org/support/users/icaleb/)
 * (@icaleb)
 * Automattic Happiness Engineer
 * [8 years, 3 months ago](https://wordpress.org/support/topic/shortcode-only-partially-working/#post-9950548)
 * Ordering by ID, date, and title are all working for me. I think you might have
   problems because of your quotes. Make sure you use simple quotes.
 *     ```
       [products limit='6' columns='2' orderby='id' order='desc']
       ```
   
    -  This reply was modified 8 years, 3 months ago by [Caleb Burks](https://wordpress.org/support/users/icaleb/).
 *  Thread Starter [Pirate Tayls](https://wordpress.org/support/users/pirate-tayls/)
 * (@pirate-tayls)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/shortcode-only-partially-working/#post-9953139)
 * Thanks! That turned out to not be the problem, but it did make me dig deeper,
   because it seemed the shortcode wasn’t the problem. Turns out the site developer
   had added a function to change the default sort order, and that was overriding
   the shortcode.
 * On the other hand, you were correct, single quotes are what I should have used.
 *  [johannestranan](https://wordpress.org/support/users/johannestranan/)
 * (@johannestranan)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/shortcode-only-partially-working/#post-10072693)
 * Hi,
    I’m dealing with the same issue, perhaps you could help me?
 * I have a snippet to change the default sort order for woocommerce products, which
   I would like to keep. However, for the [products] shortcode, there are times 
   when I would like to change the order from DESC to ASC.
 * This is the snippet I use:
 *     ```
       add_filter('woocommerce_get_catalog_ordering_args', 'am_woocommerce_catalog_orderby');
       function am_woocommerce_catalog_orderby( $args ) {
           $args['order'] = 'DESC';	    
           }
           $args['orderby'] = 'meta_value_num';
           return $args;
       }
       ```
   
 * For a certain shortcode, I would like to be able to change the order to ASC. 
   It could probably be done with a if argument, but I’m not sure how to do it.
 * Example shortcode:
    `[products columns="6" limit="6" category="forthcoming" orderby
   ="date" order="ASC" class="nyabocker-startsidan"]`
 * Any help would be appreciated!
 * Johannes

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Shortcode only partially working’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [johannestranan](https://wordpress.org/support/users/johannestranan/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/shortcode-only-partially-working/#post-10072693)
 * Status: resolved