Salary field not showing up in wp-admin Add Jobs page
-
Hi!
I tried to add the Salary field by following the tutorial on this page but the Salary field is not showing up on my front end. Below is my code in my functions.php of my child theme:
// Adding Theme Support for Custom WP Job Manager page templates add_theme_support( 'job-manager-templates' ); // Additional field for WP Job Manager in wp-admin and front-end add_filter( 'submit_job_form_fields', 'frontend_add_salary_field' ); function frontend_add_salary_field( $fields ) { $fields['job']['job_salary'] = array( 'label' => __( 'Salary (RM)', 'job_manager' ), 'type' => 'numeric', 'required' => false, 'placeholder' => 'e.g. 20000', 'priority' => 13 ); return $fields; } add_filter( 'job_manager_job_listing_data_fields', 'admin_add_salary_field' ); function admin_add_salary_field( $fields ) { $fields['_job_salary'] = array( 'label' => __( 'Salary (RM)', 'job_manager' ), 'type' => 'numeric', 'placeholder' => 'e.g. 20000', 'description' => '' ); return $fields; } // Function to display "Salary" on the single job page add_action( 'single_job_listing_meta_end', 'display_job_salary_data' ); function display_job_salary_data() { global $post; $salary = get_post_meta( $post->ID, '_job_salary', true ); if ( $salary ) { echo 'RM ' . esc_html( $salary ); } }
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Salary field not showing up in wp-admin Add Jobs page’ is closed to new replies.