InJob - Job Board WordPress Theme

Contents

1. I get many double user when update admin employer profile, How to solve this?

2. Fix the error can upload cv file on candidate dashboard

3. Override Template in Plugin InJob

4. How to translate language inJob theme

5. How to write a code to get review date on Single Employer Page

6. How to use subscription form

7. How to custom menu dashboard color

8. How to change background slider on home page

9. How to remove/add dashboard menu?

10. Import demo data 61% loading fail

11. How to make Add a job button text available on small screen?

12. How to add custom field to register form?

13. How to Update new version theme & plugins

14. How to add/edit candidate, employer, job form?

15. Why woocommerce order not complete after payment?

16. How to install child theme without lost theme config?

1. I get many double user when update admin employer profile, How to solve this?

Remove double employer posts and solve your issue with this code

add_action('init', function(){
    $error_user_id = 1;
    $linked_employer_post_id = 1;
    //Find and remove all double user for error user
    $posts = get_posts(array(
        'post_type' => 'iwj_employer',
        'posts_per_page' => -1,
        'post_status' => 'iwj-incomplete',
        'author' => $error_user_id
    ));
    if(isset($_GET['dev'])){
        foreach($posts as $p){
            wp_delete_post($p->ID, true);
        }
    }
    //Fixed error
    update_user_meta($error_user_id, '_iwj_employer_post',$linked_employer_post_id);
});

Change your $error_user_id and and $linked_employer_post_id value by your value.

Add this code to file functions.php in theme folder then run site on url: yoursite.com/?dev

Remove code after your issue solved.

2. Fix the error can upload cv file on candidate dashboard

Along with some new versions of wordpress will cause errors can not upload cv file in the candidate dashboard,


Please use the code below and overwrite the plugins /iwjob includes/class/fields/assets/js/cv.js file.


/**
 * Description of cv-field
 *
 */
jQuery(document).ready(function($){
    'use strict';
    $('.iwj-select-cv').each(function () {
        var self = $(this);
        var cv_uploader = new plupload.Uploader({
            'runtimes' : 'html5,silverlight,flash,html4',
            'browse_button' : self.attr('id'),
            'container' : self.closest('.iwj-select-cv-container').attr('id'),
            'file_data_name' : 'async-upload',
            'multiple_queues' : true,
            'max_file_size' : iwjmbCV.max_file_size,
            'url' : iwjmbCV.url,
            'flash_swf_url' : iwjmbCV.flash_swf_url,
            'silverlight_xap_url' : iwjmbCV.silverlight_xap_url,
            'filters' :  [
                iwjmbCV.filter,
            ],
            'multipart' : true,
            'urlstream_upload' : true,
            'multi_selection' : false,
            'multipart_params' : {
                '_ajax_nonce': iwjmbCV.security,
                'action': 'iwj_upload_cv',
            },
            init : {
                FilesAdded: function(up, files) {
                    var container = $(up.getOption('container'));
                    container.find('input[type="text"]').val('Uploading...');
                    var multipart_params = up.getOption('multipart_params');
                    multipart_params.remove_file_id = container.find('.iwj-select-cv').data('file-uploaded');
                    up.setOption('multipart_params', multipart_params);
                    up.refresh();
                    up.start();
                },
                FileUploaded: function(up, file, response) {
                    var data = response.response;
                    if(data){
                        data = JSON.parse(data);
                        var container = $(up.getOption('container'));
                        container.find('.iwj-select-cv').data('file-uploaded', data.ID);
                        container.find('input[type="text"]').val(data.file_name);
                        container.find('input[type="hidden"]').val(data.ID);
                    }
                },
                Error: function(up, args) {
                    $(up.getOption('container')).find('.upload-error').html(err.message);
                }
            }
        });
        cv_uploader.init();
    });
    $('.iwj-remove-cv').click(function (e) {
        e.preventDefault();
        var parent = $(this).closest('.iwj-select-cv-wrap');
        parent.find('input').val('');
    });
    $('.iwj-cv-area input[type="file"]').change(function () {
        var parent = $(this).closest('.add-new-cv');
        parent.find('.select_cv_named').html($(this).val().replace(/C:\\fakepath\\/i, ''));
    });
    $('.iwj-cv-area input[type="radio"]').change(function () {
        var value = $(this).val();
        if(value == 'add_new_cv'){
            var parent = $(this).closest('.add-new-cv');
            parent.find('input[type="file"]').trigger('click');
        }
    });
    $('.iwj-cv-area .select_cv').click(function () {
        if($('.iwj-cv-area input[type="radio"]:checked').val() == 'add_new_cv'){
            $('.iwj-cv-area input[type="file"]').trigger('click');
        }
    });
});





3. Override Template in Plugin InJob

If you need customize template in our plugin InJob you can follow our guide:

You can go to child theme create new folder iwj 

Then you copy file you want to edit from "\plugins\iwjob\templates" to folder "wp-content\themes\injob-child\iwj" then edit on it.

Example:

When you want edit file \plugins\iwjob\templates\register.php

You need copy this file to folder wp-content\themes\injob-child\iwj\register.php and edit on this.

When you want edit file \plugins\iwjob\templates\parts\jobs.php

You need copy this file to folder wp-content\themes\injob-child\iwj\parts\jobs.php and edit on this.

Notice: Please just copy files you want to make change on it. Not copy all file.

Best regards,
duongca
Inwave Support Team

4. How to translate language inJob theme

Step 1:
Go to Plugins / Add new 
Search plugin loco translate and install 
http://prntscr.com/gv02z7

Step 2: 
Go to Loco translate > Home > InWave Jobs 
http://prntscr.com/gv03cy

Step 3: 
Create New language
http://prntscr.com/gv03i0

Select Language you want 
http://prntscr.com/gv03pb

Choose Language you need translate
http://prntscr.com/gv052m

Search text you need translate 
http://prntscr.com/gv05gx

After translate 
http://prntscr.com/gv05pm

Note: You need select location file to Other. 

If you user location file author, after update plugin all translate text will remove. 

http://prntscr.com/hk7k13

5. How to write a code to get review date on Single Employer Page

Question: 

I'll replace the "By: Mr. A" by the review date. For example, if Mr. A reviewed 5 min ago, it will display "5 min ago", or if Mr. A reviewed 2 days ago, it will display "2 days ago"

Answer: 

add new function code to line 164 

http://prntscr.com/i8gfmc

function elapsedTime($time_since) {
$time = time() - $time_since;
$tokens = array (
31536000 => 'year',
2592000 => 'month',
604800 => 'week',
86400 => 'day',
3600 => 'hour',
60 => 'minute',
1 => 'second'
);
foreach ($tokens as $unit => $text) {
if ($time < $unit) continue;
$numberOfUnits = floor($time / $unit);
return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');
}
}

add new code to line 200

http://prntscr.com/i8gfu1

echo elapsedTime($item_review->time) .' ago';

http://prntscr.com/i8ggfz

I hope it help you



6. How to use subscription form

The subscription form:

Step 1: You need go https://mailchimp.com/ and sign up account.

Step 2: Just go to your Mailchimp list -> "Signup forms" -> "Embedded forms" and then take form action url in the embed code http://prnt.sc/7lieht

Step3: Go Appearance > Widgets > Footer widget 4 > Inwave Subscribe 

Paste url action (step2) to Action Url 

We hope it help you

7. How to custom menu dashboard color

If you need custom menu dashboard color. You can follow my guide: 

+ Background menu:
wp-content/plugins/iwjob/assets/css/style.css line 676
http://prntscr.com/hpd5gw

+ Background sidebar:
wp-content/plugins/iwjob/assets/css/style.css line 631
http://prntscr.com/hpd66y

+ Color font:
wp-content/plugins/iwjob/assets/css/style.css line 700
http://prntscr.com/hpd7gb

+ Color icon:
wp-content/plugins/iwjob/assets/css/style.css line 704
http://prntscr.com/hpd8eo

+ Hover color:
add new code to style.css 
.iwj-dashboard-menu li:hover a, .iwj-dashboard-menu li:hover i, .iwj-dashboard-menu li.active a, .iwj-dashboard-menu li.active i{ color:#ffffff !important; }

+ Line color: 

wp-content/plugins/iwjob/assets/css/style.css line 692

http://prntscr.com/hpda6k

+ Top line color:

wp-content/plugins/iwjob/assets/css/style.css line 754

http://prntscr.com/hpdahv

I hope it help you

8. How to change background slider on home page

Please edit home page with visual composer and follow the steps below

9. How to remove/add dashboard menu?

Hello Customer,

If you need to add new or remove the link on dashboard, you can add this custom code to your child theme functions

add_filter('iwj_get_dashboard_menus', function($menus, $position){
    $dashboard_url = iwj_get_page_permalink( 'dashboard' );
    //Remove New Job and Jobs in dashboard menu
    unset($menus['new-job']);
    unset($menus['jobs']);
    
    //remove logout menu. we will add it come back again to make sure it always show end of menu list
    unset($menus['logout']);
    //Add new menu show for all users
    $menus['custom-menu'] = array(
        'url' => add_query_arg(array('iwj_tab' => 'custom-menu'), $dashboard_url),
        'title' => '<i class="fa fa-star"></i>' . __('My Custom menu', 'iwjob')
    );
    
    $user = wp_get_current_user();
    if($user){
        //add menu for employer only
        if(in_array('iwj_employer', $user->roles)){
            $menus['employer-menu'] = array(
                'url' => add_query_arg(array('iwj_tab' => 'employer-menu'), $dashboard_url),
                'title' => '<i class="fa fa-star"></i>' . __('Employer Menu', 'iwjob')
            );
        }
        //add menu for candidate only
        if(in_array('iwj_candidate', $user->roles)){
            $menus['candidate-menu'] = array(
                'url' => add_query_arg(array('iwj_tab' => 'candidate-menu'), $dashboard_url),
                'title' => '<i class="fa fa-star"></i>' . __('Candidate Menu', 'iwjob')
            );
        }
    }
    //Add logout menu come back
    $menus['logout'] = array(
        'url' => wp_logout_url(home_url('/')),
        'title' => '<i class="fa fa-power-off"></i>' . __('Logout', 'iwjob')
    );
    return $menus;
}, 10, 2);

If you want to know what menu link key, you can find like this

If you want to write content for you custom menu link, you just create a php file with name as your menu key in location \wp-content\plugins\iwjob\templates\dashboard\

Recommend: You should use child theme to make your custom on my theme. In this case, new file should create on child theme follow path: \wp-content\themes\injob-child\iwj\dashboard\

For exam: You want create new menu link on dashboard

add_filter('iwj_get_dashboard_menus', function($menus, $position){
    $dashboard_url = iwj_get_page_permalink( 'dashboard' );
    $menus['custom-menu'] = array(
        'url' => add_query_arg(array('iwj_tab' => 'custom-menu'), $dashboard_url),
        'title' => '<i class="fa fa-star"></i>' . __('My Custom menu', 'iwjob')
    );;
    return $menus;
}, 10, 2);

You can create file with name custom-menu.php in location \wp-content\plugins\iwjob\templates\dashboard\ or \wp-content\themes\injob-child\iwj\dashboard\

Best regards,
duongca
Inwave Support Team

10. Import demo data 61% loading fail

If you install demo data theme and stop it in 61%. Because your hosting missing library ZipArchive Support

http://prntscr.com/hmrsp2

You need go to cpanel or you can contact your hosting and install Archive_Zip

http://prntscr.com/hmrsv3

I hope it help you. 

11. How to make Add a job button text available on small screen?

Hello Customers,

In some case you want to make text on button Post A Job show on smaller screen like this http://prntscr.com/kd86uc

Ok, you can add this css to your custom css (via Visual Composer or Child theme as well)

@media (max-width: 1600px) {
 .header.header-default .iw-header .iwj-action-button a.action-button {
 padding: 0 20px;
 width: auto;
 height: auto;
 line-height: inherit;
 text-align: center!important;
 overflow: visible!important;
 }
.header.header-default .iw-header .iwj-action-button a.action-button span {
 display: inline-block;
 }
 
 .header.header-default .iw-header .iwj-action-button a.action-button i {
        margin: 0 15px 0 0;
        top: 2px
    }
}
@media (max-width: 1200px) {
 .header.header-default .iw-header .iwj-action-button a.action-button {
 padding: 0 ;
 width: 40px;
 height: 40px;
 line-height: 40px;
 text-align: center;
 overflow: visible;
 }
.header.header-default .iw-header .iwj-action-button a.action-button span {
 display: none;
 }
 
 .header.header-default .iw-header .iwj-action-button a.action-button i {
        margin: 0;
        top: 0;
    }
}

Thank you for contacting us.

Best regards,
duongca
Inwave Support Team

12. How to add custom field to register form?

Hello Customers,

In some case you want to add more field to register form. Ex: Phone, Name...

Alright, You can follow this article to do that.

First you need use child theme Override Template in Plugin InJobto edit file register.php and register-popup.php in location wp-content\plugins\iwjob\templates

Then add this code to your child theme functions.php

add_action('iwj_register_process', function($uid){
    $user = IWJ_User::get_user($uid);
    $post_id = 0;
    if($user->is_employer()){
        $emp = $user->get_employer();
        $post_id = $emp->get_id();
    }
    if($user->is_candidate()){
        $cand = $user->get_candidate();
        $post_id = $cand->get_id();
    }
    
    if($post_id){
        //Also need check your custom field isset, should like this: if($post_id && isset($_POST['_iwj_phone'])){
        //Add you custom field name process here
        //Ex: update_post_meta($post_id, '_iwj_phone', sanitize_text_field($_POST['_iwj_phone']));
    }
});

13. How to Update new version theme & plugins

How to Update? 

You can follow my guide (remember backup all website before update)

Step 1: Go to FTP or Cpanel, delete old folder theme injob in :"wp-content\themes"
http://prntscr.com/gvvz1z

Step 2 : Unzip file new version theme and upload new folder theme injob to :"wp-content\themes" in your hosting
http://prntscr.com/gvvzhz

Step 3: Go to admin and update plugin 
http://prntscr.com/gvw30h

http://prntscr.com/gvw354

http://prntscr.com/gvw3dt

You can see video in here https://hoak34-gmail.tinytake.com/sf/MjE0MzM0Ml82Njg2NTcy

Note. Backup your system before upgrading

14. How to add/edit candidate, employer, job form?

Hello customer,

In some case, you want add/edit fields in candidate profile, employer profile or job form.

Here is article help you do this.

Firstly, you need implement this via child theme Override Template in Plugin InJob

1. Add/Edit field on candidate profile and employer

You also can add/edit/remove field by direct edit file wp-content\plugins\iwjob\templates\dashboard\profile\candidate-form.php

Then you need add code in functions.php on child theme to save your custom field added by you.

You can use action name candidate_update_profile for save your custom field ex:

add_action('candidate_update_profile', function($candidate){
    $custom_field = isset($_POST['your_custom_field_name'])?$_POST['your_custom_field_name']:'';
    update_post_meta($candidate->get_id(), 'your_cutsom_field_name', $custom_field);
});

Same like candidate if you want edit employer form by use action name employer_update_profile

2. Add/edit field on job form

Seem candidate and employer. You need edit two file

- add new: wp-content\plugins\iwjob\templates\dashboard\new-job\form.php

- edit form: \wp-content\plugins\iwjob\templates\dashboard\edit-job.php

And use action for save job 

add_action('iwj_update_job', 'update_job_custom_field');
add_action('iwj_add_new_job', 'update_job_custom_field');
function update_job_custom_field($post_id) {
    $custom_field = (isset($_POST['custom_field']) && $_POST['custom_field']) ? sanitize_text_field($_POST['custom_field']) : '';
    update_post_meta($post_id, 'custom_field', $custom_field);
}

15. Why woocommerce order not complete after payment?

Woocommerce said "If the payment has been successful and the order does not contain Digital or Downloadable products, the order will be set to Processing" http://prntscr.com/md48nn

So you need disable manager stock in your site WP admin page => Woocoomerce => Settings => Products => Inventory http://prntscr.com/md48vr

Please see more info https://docs.woocommerce.com/document/managing-orders/

16. How to install child theme without lost theme config?

Hello Customer,

In some case you want to do some custom on your theme. I recommend you use child theme to do that. It helpful when you want update theme because this will help you update parent theme without lost custom code. 

However if you using parent theme, when you install and active child theme. Your site theme option will lost. So how to keep your theme theme option when you install and active child theme.

Easy please follow some steps.

1. Backup cho current theme settings and copy theme option codes

2. Install and active your child theme and then paste your theme options to restore

Ok all done.

In case you activated child theme, you just active your parent theme again then follow two steps above.

Best regards,
duongca
Inwave Support Team