Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Mods to sort categories in simple drag and drop

  1. #1
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,790
    Thanks
    166
    Thanked 3,393 Times in 3,264 Posts

    Mods to sort categories in simple drag and drop

    Classipress only has the option to order the categories by name and post ID. With this mods, sorting of the ads categories can be done in simple drag and drop.

    As always, make a backup of the files involved including the database just in case something is not working right.

    Step 1. Before installing the plugin, you need to modify some codes in the theme-functions.php;

    A. In line 1771 look for the code below;

    Code:
    $cats = get_terms(APP_TAX_CAT, 'hide_empty=0&hierarchical=0&pad_counts=1&show_count='.$cp_cat_parent_count.'&orderby='.$cp_cat_orderby.'&order=ASC');
    and replace it with this;

    Code:
    $cats = get_terms(APP_TAX_CAT, 'hide_empty=0&hierarchical=0&pad_counts=1&show_count='.$cp_cat_parent_count.'&orderby=order&order=ASC');
    B. In line 1803 look for the code below;

    Code:
    $subcats = @wp_list_categories('orderby='.$cp_cat_orderby.'&taxonomy='.APP_TAX_CAT.'&order=asc&show_count='.$cp_cat_child_count.'&hierarchical=0&pad_counts=1&use_desc_for_title=1&hide_empty='.$cp_cat_hide_empty.'&depth=1&title_li=&echo=0&number='.$subs.'&child_of='.$cat->term_id.'&show_option_none='.get_option('cp_cat_strip_nocatstext'));
    and replace it with this;

    Code:
    $subcats = @wp_list_categories('orderby=order&taxonomy='.APP_TAX_CAT.'&order=asc&show_count='.$cp_cat_child_count.'&hierarchical=0&pad_counts=1&use_desc_for_title=1&hide_empty='.$cp_cat_hide_empty.'&depth=1&title_li=&echo=0&number='.$subs.'&child_of='.$cat->term_id.'&show_option_none='.get_option('cp_cat_strip_nocatstext'));
    As you can see we have only changed the "orderby" parameter in the above codes.

    Step 2. Install the modified plugin (attached) and activate it. Go to the Wordpress Admin>>Posts>>My Category Order. In the Taxonomy dropdown option choose "Ads Categories and click on "Change Taxonomy". You will then presented with the lists of categories of which you can re-order through drag and drop.

    The modified plugin is based on the popular "My Category Order" plugin which can only order the standard post categories and not custom taxonomies.

    There you go.
    Attached Files Attached Files
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  2. The Following 10 Users Say Thank You to jomarkosabel For This Useful Post:

    asperty (October 9th, 2011), barukar (September 9th, 2011), Bredvig (September 10th, 2011), eaport (March 19th, 2012), emilianoaguirre (July 18th, 2012), junnydc (September 20th, 2011), mzaha (December 17th, 2013), pinocchio (September 10th, 2011), rubencio (September 22nd, 2011), spymare (September 22nd, 2011)

  3. #2
    Veteran barukar's Avatar
    Join Date
    Sep 2010
    Location
    Brasil, São Paulo, SP
    Posts
    6,785
    Thanks
    186
    Thanked 742 Times in 623 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    -------------------------------------------------------------------------------------------
    Projects: ClassiNoiva - Classimóveis - vocênoenem - i50 - Clube DETRAN

  4. #3
    Member Bredvig's Avatar
    Join Date
    Jul 2010
    Location
    Dublin, Ireland
    Posts
    70
    Thanks
    2
    Thanked 10 Times in 7 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. #4
    rubencio's Avatar
    Join Date
    May 2010
    Location
    Spain
    Posts
    3,804
    Thanks
    268
    Thanked 316 Times in 278 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

    r u b e n c i o . c o m


    Since 2010 providing AppThemes solutions,
    Plugins and the best childthemes...



  6. #5
    Veteran spymare's Avatar
    Join Date
    Aug 2010
    Location
    Denmark
    Posts
    871
    Thanks
    16
    Thanked 82 Times in 61 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    ♣ Display your classifieds site in Grid format
    Demo >> http://www.places-finder.com
    Thread >> https://forums.appthemes.com/theme-pl...comment-21709/
    Created by Mr. Green

  7. #6
    Veteran vienna's Avatar
    Join Date
    May 2010
    Location
    Vienna, Austria
    Posts
    718
    Thanks
    19
    Thanked 177 Times in 118 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  8. #7
    Rookie asperty's Avatar
    Join Date
    Sep 2011
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  9. #8
    Newbie webmarketingsmart's Avatar
    Join Date
    Oct 2011
    Location
    United States
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  10. #9
    Member andrewthompson's Avatar
    Join Date
    Oct 2011
    Posts
    50
    Thanks
    3
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  11. #10
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,790
    Thanks
    166
    Thanked 3,393 Times in 3,264 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Idiot needs help, presumably simple problem :/ RELATED CATEGORIES/ADVERTS
    By epiazk in forum ClassiPress General Discussion
    Replies: 3
    Last Post: September 11th, 2011, 01:16 AM
  2. Can't drag and drop widgets
    By hboeriu in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: April 8th, 2011, 08:46 PM
  3. Trying to figure out simple 'sort by' function
    By g2computer in forum ClassiPress General Discussion
    Replies: 8
    Last Post: February 28th, 2011, 05:25 PM