NooTheme Premium WordPress Theme › Forums › Jobica › Filter Company based on a custom field
Tagged: company, custom fields, filter
- This topic has 10 replies, 2 voices, and was last updated 4 years, 3 months ago by dangdv.
-
AuthorPosts
-
4 years, 3 months ago #1206193
Hi,
We would need to filter the list of company by a custom field.
Basically we have company types (Standard and training center) offering Jobs or training. We have a [Type] field (Company / Training Centre) and we need to list all the Training Centre.Could you please point us on how to create the url with this parameter.
I tried:https://medinjob.io/companies/?company_jbc_company_field_type=centre_formation
centre-formation being the value for the [Type] field I need to filter on, but it seems to return all companies not just the companies with the training centre type?
Any idea? perhaps via a function?
I look forward to your reply
Cheers
4 years, 3 months ago #1206242This reply has been marked as private.4 years, 3 months ago #1206252This reply has been marked as private.4 years, 3 months ago #1206274Hi again,
I have another question please relating to the Company Filter as well.
When going to a company listing by category the url is:./companies/?company_category=###
Would it be possible to have it so it list all except one category? with another operator than (=)
Thank you
s
4 years, 3 months ago #1206299Sorry, I have check Jobmonster theme again, i see the Jobmonster not support filter Companies by custom fields.
Best regards.
4 years, 3 months ago #1206308Hello again,
I am using Jobica actually.
Can I filter maybe by custom field using a url parameter? with an exception?
Ie if I want to list companies of all categories but one?
Can you confirm that the Categories for companies are the same as for the job? It seems strange that the companies CPT share the same category taxonomies as the jobs?
Now, if this is not possible woul dit be possible to get a quote on creating this fonctionality please? or do you have a contact for a develloper that could assist us with this custom requirements then?
Thank you for your time
Stephane
4 years, 3 months ago #1206373This reply has been marked as private.4 years, 3 months ago #1206574Hi,
We have 2 distinct company profile, one for standard company and one for Training center.
They offer different type of offers (Jobs/Training)
I have created a Custom field to select types and also created a category "training centre"
I need to have the list of training center separate from other company type.
So far I can filter on only training center using the category filter (https://medinjob.io/companies/?company_jbc_company_field_type=centre_formation)
But I can't list ll other company but NOT training center?
Can I have a list of all company but not training venter, either excluding by category or by custom field?
thx
s
4 years, 3 months ago #1206628This reply has been marked as private.4 years, 3 months ago #1206689Hello,
No I didn't add an custom code, but I can see all the companies @: https://medinjob.io/companies/
And only the centre de formation here: https://medinjob.io/companies/?company_jbc_company_field_type=centre_formation
I'm curious to know why you don't see anything on: https://medinjob.io/companies/
Can you please confirm you can please?
4 years, 3 months ago #1206735Dear, to display Companies on company archive page by type, please add custom code in file functions.php of your theme.
add_filter( 'pre_get_posts', function($query){ if ($query->is_post_type_archive('noo_company') && isset($_GET['type']) ) { $type = (string) wp_unslash( $_GET['type'] ); $meta_query = $query->get( 'meta_query' ); if ( ! is_array( $meta_query ) ) { $meta_query = array(); } $meta_query[] = array( 'key' => '_jbc_company_field_type', 'value' => $type ); $query->set( 'meta_query', $meta_query ); } });
then check with url: https://medinjob.io/companies/?type=###
eg:https://medinjob.io/companies/?type=entreprise
https://medinjob.io/companies/?type=centre_formationBest regards.
-
AuthorPosts
You must be logged in and have valid license to reply to this topic.