Title: Plugin doesn&#8217;t work on page template
Last modified: February 27, 2017

---

# Plugin doesn’t work on page template

 *  Resolved [mateuszbajak](https://wordpress.org/support/users/mateuszbajak/)
 * (@mateuszbajak)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-on-page-template/)
 * Hi,
    Plugin is awesome 🙂 But works only on category.php I need order my categories
   on page-slug.php template too.
 * How to do that? I tried this and it doesn’t work:
 *     ```
       $args = array(
               'posts_per_page' => -1,
               'parent'  => 0,
               'hide_empty' => false,
               'orderby' => 'meta_value',
               'order' => 'ASC',
               'meta_key' => 'tax_position'
            );
       $tax_terms = get_categories($args);
       ```
   
 * Is there a temporary solution until update release?
 * Thanks in advance,
    Regards, Mateusz Bajak

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

 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-on-page-template/#post-8853273)
 * Hello Mateusz,
 * I’m a bit confused about what you’re trying to achieve. Are you trying to return
   different types of taxonomies, in the order defined by the user? If so, here 
   is my response:
 * I’ve been very busy this morning so I haven’t been able to test this myself, 
   but I believe there are two issues with the snippet you shared.
 * First, you should be using the `get_terms()` function instead of `get_categories()`.`
   get_terms()` will allow you to retrieve any type of taxonomy (tags/categories/
   custom-defined taxonomies), while `get_categories()` will only return the categories.
 * Second, I believe your `orderby` call should be set to `'tax_position'`.
 * Can you try this snippet:
    ` $args = array( ‘taxonomy’ => ‘my_taxonomy’ // your
   taxonomy here, e.g. categories, tags, custom ‘posts_per_page’ => -1, ‘parent’
   => 0, ‘hide_empty’ => false, ‘orderby’ => ‘tax_position’, ‘order’ => ‘ASC’, ‘
   meta_key’ => ‘tax_position’ ); $tax_terms = get_terms( $args ); `
 * Let me know if (1) that works or (2) if I misunderstood your question/objective.
 * Cheers,
    Kevin.
 *  Thread Starter [mateuszbajak](https://wordpress.org/support/users/mateuszbajak/)
 * (@mateuszbajak)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-on-page-template/#post-8855697)
 * Hi Kevin,
 * Quick response 🙂
    I use `get_categories()` becouse I need to order categories(
   I don’t have any other taxonomies). Anyway:
 * I tried set `‘orderby’ => ‘tax_position’` before I wrote this topic. Unfortunetly
   this doesn’t work.
 * I need to get categories in order defined by user on page-slug.php <– Is that
   clear now? 🙂 I know I have not very well grammar (I’m not native English). Sorry
   about that.
 * Thanks in advance,
    Regards, Mateusz Bajak
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-on-page-template/#post-8857219)
 * Hi Mateusz,
 * Your grammar is fine :-). What I’m not understanding (and I apologize if I’m 
   being dense here) is what you mean by `page-slug.php`? You’re trying to retrieve
   the `categories` taxonomy defined by the user, and on which page does the user
   define this order? Unless I’m mistaken, for each taxonomy (e.g. categories), 
   there is only one page where you can re-arrange them (e.g. `{wordpress_site}/
   wp-admin/edit-tags.php?taxonomy=category`).
 * Let me know!
    Kevin.
 *  Thread Starter [mateuszbajak](https://wordpress.org/support/users/mateuszbajak/)
 * (@mateuszbajak)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-on-page-template/#post-8906767)
 * Hi,
 * Sorry for that I wasn’t replay. Anyway:
    By page-slug.php I meant a page template
   for example page-contact.php or page-gallery.php Below is a link to tutorial 
   what is a page template and how to create one: [http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/](http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/)
 * Best regards,
    Mateusz
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-on-page-template/#post-8907335)
 * Hi [@mateuszbajak](https://wordpress.org/support/users/mateuszbajak/),
 * I understand you now. I’m testing this right now and I’ll get back to you soon.
 * Kevin.
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-on-page-template/#post-8907404)
 * Hi [@mateuszbajak](https://wordpress.org/support/users/mateuszbajak/),
 * I just tested this and it worked fine for me.
 * Here is what I did:
    – Using a fairly clean install (not many other plugins or
   data) – Created a new page template “page-testing.php” – Added the following 
   code to my page template:
 *     ```
       $args = array(
               'posts_per_page' => -1,
               'parent'  => 0,
               'hide_empty' => false,
               'orderby' => 'meta_value',
               'order' => 'ASC',
               'meta_key' => 'tax_position'
            );
       $tax_terms = get_categories( $args );
   
       echo '<pre>'; var_dump( $tax_terms ); echo '</pre>';
       ```
   
 * – Created a new post and assigned it to my “page testing” template
    – Added 5
   taxonomy terms to the `category` taxonomy – Ordered them – Loaded my page template–
   Categories were in order I specified in the admin
 * I made new terms, changed the order, etc. and each time the order was returned
   correctly.
 * I’m not sure what I’m doing differently than you. Do you see any differences 
   in what I did compared to what you’re doing?
 * Let me know,
    Kevin.
    -  This reply was modified 9 years, 2 months ago by [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/).
 *  Thread Starter [mateuszbajak](https://wordpress.org/support/users/mateuszbajak/)
 * (@mateuszbajak)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-on-page-template/#post-8911206)
 * I checked my code again and I saw that I printed my taxonomies in wrong way (
   stupid me) ;_;
    Sorry for that. Anyway thanks in help 🙂
 * Regards,
    Mateusz
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-on-page-template/#post-8912208)
 * Hey Mateusz,
 * No problem glad it’s working 🙂

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

The topic ‘Plugin doesn’t work on page template’ is closed to new replies.

 * ![](https://ps.w.org/simple-taxonomy-ordering/assets/icon-256x256.jpg?rev=2489936)
 * [Simple Taxonomy Ordering](https://wordpress.org/plugins/simple-taxonomy-ordering/)
 * [Support Threads](https://wordpress.org/support/plugin/simple-taxonomy-ordering/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-taxonomy-ordering/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-taxonomy-ordering/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-taxonomy-ordering/reviews/)

## Tags

 * [page template](https://wordpress.org/support/topic-tag/page-template/)

 * 8 replies
 * 2 participants
 * Last reply from: [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-on-page-template/#post-8912208)
 * Status: resolved