Where to enter various location? Any chance to change fields?

Hi there,

we are wondering where could we enter multiple location for Job offers we have e.g. in each State and/or many countries?

Is it possible to to increase number of days how long a position will be available as a vacancy?

We are thinking e.g. for a solution similar to events...

Thank you in advance.
Prinz

  • Vinod Dalvi

    Hi Prinz,

    I hope you are well today and thank you for your question.

    we are wondering where could we enter multiple location for Job offers we have e.g. in each State and/or many countries?

    You can create fields for them using the code shared in the following rely.

    https://premium.wpmudev.org/forums/topic/search-should-return-location-results-jobs-experts#post-824388

    Is it possible to to increase number of days how long a position will be available as a vacancy?

    You can set the number of days how long a position will be available as a vacancy by setting it in the Job Open for field as shown in the attached screenshot.

    By default the maximum allowed days for this field is 21 days but you can increase it by using the attached small plugin containing the following code.

    function custom_je_open_days_limit( $data ){
    
    	$temp_data = array( 60, 120 ); // Add days here separated by comma
        foreach ($temp_data as $day) {
            $data[$day] = $day . ' ' . __('Days', 'jbp');
        }
    	return $data;
    }
    add_filter('je_open_days_limit', 'custom_je_open_days_limit');

    Add the days in the temp_data array in the plugin code whatever you want to use.

    Best Regards,
    Vinod Dalvi

  • Klaus

    Hi Vinod,

    thanks for prompt reply. I need a bit more information HOW TO... as I've never entered any code means I don't have a clue where to put in the mentioned code. Would you mind to lead me a bit more?

    1) You can create fields for them using the code shared.... where to enter?
    2) By default the maximum 21 days ... attached small plugin containing the following code.
    Uploaded and activated plugin; add the days in the temp_data array in the plugin.
    Were do I find the temp_data array to modify according our needs? Please assist more.

    Thank you.
    Prinz

  • Ash

    Hello @Prinz

    I hope you are well today.

    1. You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    2. Check the line:
    $temp_data = array( 60, 120, );
    Here the days starts from 60 and ends at 120. You just need to change these two values, the lower limit and the upper limit :slight_smile:

    Hope it helps :slight_smile: Please feel free to ask more question if you have any.

    Cheers
    Ash

  • Klaus

    Hello Ash,

    indeed and once more your explanation is brilliant... exactly in a way I do understand. However, I can't figure out why what I did wrong that I don't get a location field added.

    Here is what I did:

    1) Created a new file within mu-plugin folder and placed needed code into it (incl. start and end tag). Went to my website http://humanresources.bestofthebestonly.com... but no additional field available there. Would you mind to login and check out were the failure is? Support access granted.

    2) I must be blind obviously because I can no where find the file/place where to modify this code to change timeframe. In which folder do I have to search for that?

    function custom_je_open_days_limit( $data ){
    $temp_data = array( 60, 120, );
    // Add days here separated by comma foreach ($temp_data as $day) {
    $data[$day] = $day . ' ' . __('Days', 'jbp');
    }
    return $data;
    }
    add_filter('je_open_days_limit', 'custom_je_open_days_limit');

    Looking forward to hear from you again.
    Thank you in advance
    Prinz

  • Vinod Dalvi

    Hi Prinz,

    1) Created a new file within mu-plugin folder and placed needed code into it (incl. start and end tag). Went to my website http://humanresources.bestofthebestonly.com... but no additional field available there. Would you mind to login and check out were the failure is? Support access granted.

    We can't access mu plugins from admin area so i added the provided code in the Quick Custom Solution Plugin that you are using on your site by network activating it and now the location custom field is getting displayed on the add new job form as shown in the attached screenshot.

    Please check it and let me know how it works for you.

    2) I must be blind obviously because I can no where find the file/place where to modify this code to change timeframe. In which folder do I have to search for that?

    You should add it in the $temp_data array in the previously shared code as displayed in the attached screenshot.

    If you can't do it then let us know what days you want to add so that we can add it in your site.

    Regards,
    Vinod Dalvi

  • Klaus

    Hi Vinod,

    indeed I appreciate much what you did, big thank you for it. Yes I do have the location field now at hand and entries in it works too.

    Would you mind taking your kind offer to update the $temp_data array for me too (seriously I do not find the space where to do that). We would need the additional value of 60, 120 and 180 days as selection option. Support access is still granted.

    Big Thank you in advance for that too.
    Kind regards
    Prinz

  • Klaus

    Hello Vinod,

    thanks so much for this favor. Meanwhile - based on screeshoot you posted yesterday - finally I could figure out where and how you entered the needed modification. BUT unfortunately when I go to our humanresources.bestofthebestonly.com there does not appear the added values nor am I able to select one of those entries.

    Deleted also cache... but did not work out. Would you have a clue why you are able to see those modification and I am not?

    Looking forward to hear from you again.
    Kind regards
    Prinz

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.