Category menu rearrangement available?

This topic contains 9 replies, has 2 voices, and was last updated by  Stiofan O’Connor 8 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #369171

    rigots
    Lifetime Member
    Post count: 275

    Hi,
    I created a Custom Post Type name ‘Service’ with 5 categories. Then I included ‘Category’ in Geodirecory->Service Settings->Advance Search.
    So in my front home page I get this category pull down menue with all my categories but I have a “Other” category that I like to appear on the buttom not in the middle of my categories in the pull down menu.

    Is there a way to push the ‘Other’ category to appear at the bottom of the pull down menu? not in the middle.

    Thank you

    #369172

    rigots
    Lifetime Member
    Post count: 275
    This reply has been marked as private.
    #369178

    rigots
    Lifetime Member
    Post count: 275

    One more thing,
    With the chrome inspect tool, I see the ‘Select’ code with all the ‘options’. If I could just modify the code I could just change the order and put the ‘Other’ option at the bottom, but since I can’t modify code do to future updates I need t figure out another way to do these.

    Any suggestions? Can the order be changed with CSS?
    Below is the code:

    <select name=”sgd_servicecategory[]” class=”cat_select”>
    <option value=””>All Categories</option>
    <option value=”75″>Catering</option>
    <option value=”77″>Entertainment</option>
    <option value=”102″>Other</option>
    <option value=”76″>Photography</option>
    <option value=”47″>Venues</option></select>

    Thank you.

    #369194

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hello,

    By default there it is listed in A-Z, this can be filtered to change the order query but i am not sure how you would make that the bottom one via a query.
    You could also filter the entire input html to strip and replace it to the end using this filter

    apply_filters( 'geodir_search_filter_field_html_output_taxonomy', $html, $field_info, $post_type );

    Thanks,

    Stiofan

    #369206

    rigots
    Lifetime Member
    Post count: 275

    Hi Stiofan,
    Yes the default is A-Z, to it is alphabetically that is my other option is in the middle.

    I am not sure how you would filter the entire input html, strip the selection and then replace them in a new order.

    I tried adding the code snippet you provided that I am not sure what that is doing, I don’t see any difference on my website.

    Could you elaborate a bit more on how to re-order the selection options with a code snippet?

    Thank you.

    #369299

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I was actually referring to the wrong hook as its on the main search form, i have updated it on ur site and for future reference this is it here:

    
    
    add_filter('geodir_search_output_to_main_taxonomy','_my_cat_order_change',10,3);
    function _my_cat_order_change($html, $field_info, $post_type){
      
      $html = str_replace('<option value="102"  >Other</option>', '', $html);
      $html = str_replace('</select>', '<option value="102"  >Other</option></select>', $html);
    
      return $html;
    }

    Thanks,

    Stiofan

    #369356

    rigots
    Lifetime Member
    Post count: 275

    Hi Stiofan,

    That did it!

    Thank you.

    #369389

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    You are welcome 🙂

    #369704

    rigots
    Lifetime Member
    Post count: 275

    Hi Stiofan,
    I have similar issue with my ‘GD->CPT Categories’ widgets. I put on of these widgets at the bottom of my detail page so people could click and go to any category.

    This ‘GD->CPT Categories’ widget has the option to sort Alphabetically or by count. I am choosing alphabetically so I get to see Catering, Entertaiment, Other, Photography and Venues in that order.

    I want other the third item to appear at the button.
    I see in the code under .gd-cptcats-widget .gd-cptcat-row.gd-cptcat-gd_service.gd-cpt-flat
    that their is an ordered list that holds this items, since I just can’t change the code on the file.

    I need to be able to do this with a code snip as you did before.

    Any chance you could help me out with this one too and provide a code snippet on how to put “Others” the their item to the bottom?

    It is on my to do, to learn how these code snippet hooks work.

    Thank you.
    Rigo

    #369782

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Rigo,

    We don’t do customisation, we will tell you how and where hooks are and give examples but if you dont understand how to do some things you should hire a developer. We put all our time into improving our products as a whole instead of providing customisations.

    Thanks,

    Stiofan

Viewing 10 posts - 1 through 10 (of 10 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount