Skip to content

Instantly share code, notes, and snippets.

@yousufansa
Created April 20, 2020 08:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yousufansa/46e5f7c563ac7600f9bef583dd28718f to your computer and use it in GitHub Desktop.
Save yousufansa/46e5f7c563ac7600f9bef583dd28718f to your computer and use it in GitHub Desktop.
MAS WPJMC - Companies Posted Jobs in Single Company
if( ! function_exists( 'mas_wpjmc_single_company_job_listings' ) ) {
function mas_wpjmc_single_company_job_listings() {
global $post;
$company_jobs = mas_wpjmc_get_the_company_job_listing();
if( count( $company_jobs ) ) :
?><div class="mas-company-jobs"><?php
?><h3 class="mas-company-jobs__title"><?php
echo apply_filters( 'mas_wpjmc_company_jobs_title', esc_html__( 'Jobs by This Company', 'mas-wp-job-manager-company' ) );
?></h3><?php
get_job_manager_template( 'job-listings-start.php' );
foreach( $company_jobs as $post ) :
setup_postdata($post);
do_action( 'job_listing_loop' );
get_job_manager_template_part( 'content-job_listing' );
endforeach; // End of the loop.
wp_reset_postdata();
get_job_manager_template( 'job-listings-end.php' );
?></div><?php
endif;
}
}
add_action( 'single_company', 'mas_wpjmc_single_company_job_listings', 50 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment