NooTheme Premium WordPress Theme › Forums › Jobica › Job Location filter in Job Filter Widget
Tagged: Job Filter Widget, job locations, Job Sidebar
- This topic has 5 replies, 2 voices, and was last updated 4 years, 7 months ago by enumans.
-
AuthorPosts
-
4 years, 7 months ago #1099188
Almost all filter options are displayed in the Job Filter Widget, except for one: Job Locations.
Instead of the By Distance (exact address) filter I'd like to show the Job Locations I specified. It's the only option not displayed in the filter options however. How can I achieve this?
Attachments:
You must be logged in to view attached files.4 years, 7 months ago #1100222Dear, to display Job Location in filter widget, please go to admin menu 'Jobica -> Custom Fields -> Job tab' and change 'job_location' field to Multi Location, you will see Job Location in Job filter widget select.
Best regards.
4 years, 7 months ago #1100257Hi. Thanks for your reply.
The custom field 'job_location' is set to Multi location. But the Job Filter Widget shows the 'Custom field: by distance' option and not the 'Job Location' option. See attachments.
(I want users to be able to click/filter on a list of Job Locations I specified manually.)
Attachments:
You must be logged in to view attached files.4 years, 7 months ago #1101171I've found a solution.
The Job Location (multi_location) is not added to the Job Filter Widget by default. So this option is unfortunately not available by default.
Now I've modified the jobica core plugin, to make this work. I've modified the following file:
\wp-content\plugins\jobica-core\framework\libs\custom-fields\custom-fields.phpOn line number 51 there is the following function: jbc_filterable_custom_fields()
I've added the 'multi_location' to the available options listed there, and this all seems to work. The resulting code is:
if(!function_exists('jbc_filterable_custom_fields')):
function jbc_filterable_custom_fields(){
$types = array(
'select',
'multiple_select',
'single_tax_location',
'multi_tax_location',
'radio',
'checkbox',
'price_range',
'multi_location' /* ADDED */
);
return $types ;
}
endif;It would be great is this modification can be implemented in the next update, so my changes don't get overwritten and they're available for everyone.
Attachments:
You must be logged in to view attached files.4 years, 7 months ago #1101693Dear, plugin update Jobica theme to latest version 1.2.3 from ThemeForest, then update plugin Jobica Core to latest version included in theme. in new version you can use hook to add custom filter select type.
Example, after update theme and plugin core to latest version, please switch your site to use Jobica child theme and add custom code in file functions.php of child theme.
add_filter('jbc_filterable_custom_fields', function($types){ $types[] = 'multi_location'; return $types; });
Best regards.
4 years, 7 months ago #1102448Thanks for the update! An even better solution!
-
AuthorPosts
You must be logged in and have valid license to reply to this topic.