Forums › Geo Job Manager › gjm_orderby – appears to be broken
- This topic has 4 replies, 2 voices, and was last updated 5 years, 11 months ago by
Patrik.
-
AuthorPosts
-
August 19, 2016 at 7:42 am #53739
Patrik
MemberHello Eyal,
I have this set on the homepage:
[jobs gjm_use="1" gjm_orderby="title,distance,date" gjm_auto_locator="0" gjm_radius="40"]
When I search for example for “maths” I would expect result would be prioritised based on the keyword in the title. That’s not however what I am seeing. See the attached example. Here the “Teacher of Science” shows up before “Teacher of Maths”.
Your advice would be very much appreciated.
Best Regards.
Private Content HiddenAttachments:
You must be logged in to view attached files.August 19, 2016 at 9:28 pm #53742Eyal Fitoussi
MemberHello patrik,
That is not exactly how the orderby of Jobs Geolocation plugin works. Setting the shortcode attribute the way you did ( gjm_orderby=”title,distance,date” ) only tells the plugin the order that the items will show in the orderby dropdown menu. However, when performing a search and nothing is selected in the dropdown menu ( when is on set to “Order By” ), the plugin will use the orderby that is set in WP Job Manager plugin as the default. And because in your form the orderby menu is hidden and always set on the “order by”, it will order the posts by “Featured”.What you need to do is set the order by of WP Job Manager plugin to “Title” by adding
1orderby="title"to the shortcode. That, I believe, will solve your issue.
Let me know if that helps.
August 20, 2016 at 6:16 am #53748Patrik
MemberThank you for the clarification Eyal. It would be useful to add this shortcode to the documentation page.
I have tried this:
1[jobs gjm_use="1" orderby="featured,title,distance,date" gjm_auto_locator="0" gjm_radius="40"]It did not work as expected. None of the premium jobs were shown on top. Could you tell me more about how this is handled?
We have added more products using menu_order with higher than featured priority so maybe these are ignored:
1234567891011121314151617181920212223if($post->post_type == 'job_listing') {if($post->menu_order == -3){$classes[] = 'gold-jobs';}if($post->menu_order == -2){$classes[] = 'silver-jobs';}if($post->menu_order == 1){$classes[] = 'organic-jobs';}if($post->menu_order == 0){$classes[] = 'bronze-jobs';}}Even if I try just:
1[jobs gjm_use="1" orderby="title" gjm_auto_locator="0" gjm_radius="40"]I do not get the search results I would expect. I am happy to give you access to our staging environment.
August 21, 2016 at 7:03 pm #53768Eyal Fitoussi
MemberHi Patrik,
There are two different orderby shortcode attributes.
1) orderby – this shotrcode attribute belongs to WP Job Manager plugin ( not Job Manager Geolocation add-on ) and thats why it does not exists on my documentation page. But it does exist on the WP Job Manager plugin docs. This orderby attribute will accept a single value that will be used as the default orderby of the search results.
2) gjm_orderby – this shortcode attribute provided by Job Manager Geolocation add-on. This attribute enhance the “orderby” feature provided by WP Job Manager plugin and allows you to have multiple values that will be displayed as a dropdown menu in the search form. Now, when performing a search and nothing is selected in the gjm_orderby dropdown menu ( when the “order by” is selected ), then the default ordering of the results will be based on what you entered in the “orderby” ( of WP Job Manager plugin ) shortcode attribute.
I know it confusing but let me know if the explanation above helps.
August 22, 2016 at 6:26 am #53779Patrik
MemberThank you for the clarification Eyal. This makes a lot more sense now.
I have also found this useful discussion on the subject:
https://wordpress.org/support/topic/sorting-job-listings?replies=20 -
AuthorPosts
You must be logged in to reply to this topic.