Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter directukjobs

    (@directukjobs)

    @jonryan Thank you.

    • This reply was modified 8 years, 12 months ago by directukjobs.
    Thread Starter directukjobs

    (@directukjobs)

    Hi

    Ok got it working. (Silly mistake) Thanks for the info… (Happy) The following code works to enable comments on jobs. Just a note. I have the lighthouse theme and every time it updates it overwrites the functions.php. So if you have this in there or other code like deleting old posts. It’s gonna be gone every time you update.
    anyway here is the correct code to enable comments on job listings.

    // Add comment support to the post type
    add_filter( 'register_post_type_job_listing', 'register_post_type_job_listing_enable_comments' );
    
    function register_post_type_job_listing_enable_comments( $post_type ) {
    	$post_type['supports'][] = 'comments';
    	return $post_type;
    }
    
    // Make comments open by default for new resumes
    add_filter( 'submit_job_listing_form_save_job_listing_data', 'custom_submit_job_listing_form_save_job_listing_data' );
    
    function custom_submit_job_listing_form_save_job_listing_data( $data ) {
    	$data['comment_status'] = 'open';
    	return $data;
    }
    • This reply was modified 8 years, 12 months ago by directukjobs.
    Thread Starter directukjobs

    (@directukjobs)

    Hi, Thank you for the information. I tried the following code but still no luck. I should mention I have lighthouse theme. Should it be in the start of functions.php or end?

    // Add comment support to the post type
    add_filter( ‘register_post_type_job_listing’, ‘register_post_type_job_listing_enable_comments’ );
    
    function register_post_type_job_listing_enable_comments( $post_type ) {
    $post_type[‘supports’][] = ‘comments’;
    return $post_type;
    }
    
    // Make comments open by default for new jobs
    add_filter( ‘submit_job_form_save_job_data’, ‘custom_submit_job_form_save_job_data’ );
    
    function custom_submit_job_form_save_job_data( $data ) {
    $data[‘comment_status’] = ‘open’;
    return $data;
    }
Viewing 3 replies - 1 through 3 (of 3 total)