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-
AuthorPosts
-
March 22, 2017 at 6:06 pm #369171
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
March 22, 2017 at 6:09 pm #369172This reply has been marked as private.March 22, 2017 at 6:25 pm #369178One 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.
March 22, 2017 at 7:09 pm #369194Hello,
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 filterapply_filters( 'geodir_search_filter_field_html_output_taxonomy', $html, $field_info, $post_type );
Thanks,
Stiofan
March 22, 2017 at 7:43 pm #369206Hi 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.
March 23, 2017 at 12:56 pm #369299I 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
March 23, 2017 at 4:32 pm #369356Hi Stiofan,
That did it!
Thank you.
March 23, 2017 at 6:32 pm #369389You are welcome 🙂
March 24, 2017 at 11:24 pm #369704Hi 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.
RigoMarch 25, 2017 at 1:53 pm #369782Hi 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
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket