Created
September 28, 2017 14:55
-
-
Save tripflex/db6beb09ce2918d82c58c15b91dec723 to your computer and use it in GitHub Desktop.
Add Job Categories to Job Alerts email template (https://wpjobmanager.com/document/overriding-add-template-files/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $post; | |
$type = get_the_job_type(); | |
$location = get_the_job_location(); | |
$company = get_the_company_name(); | |
// The arguments after 'job_listing_category' is "before" then "separator" then "after" | |
$job_categories = get_the_term_list( $post->ID, 'job_listing_category', '', ', ', '' ); | |
echo "\n"; | |
// Job type | |
if ( $type ) { | |
echo esc_html( $type->name ) . ' - '; | |
} | |
// Job title | |
echo esc_html( $post->post_title ) . "\n"; | |
// Location and company | |
if ( $location ) { | |
printf( __( 'Location: %s', 'wp-job-manager-alerts' ) . "\n", esc_html( strip_tags( $location ) ) ); | |
} | |
if ( $company ) { | |
printf( __( 'Company: %s', 'wp-job-manager-alerts' ) . "\n", esc_html( strip_tags( $company ) ) ); | |
} | |
if( $job_categories ){ | |
printf( __( 'Categories: %s', 'wp-job-manager-alerts' ) . "\n", esc_html( strip_tags( $job_categories ) ) ); | |
} | |
// Permalink | |
printf( __( 'View Details: %s', 'wp-job-manager-alerts' ) . "\n", get_the_job_permalink() ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment