Created
October 22, 2018 10:58
-
-
Save yousufansa/eaf2bbf853b21305fda0104b0a02b3a2 to your computer and use it in GitHub Desktop.
Jobhunt - Display Job Description Excerpt In Job Listings
This file contains hidden or 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
if ( ! function_exists( 'jobhunt_template_job_listing_desc_excerpt' ) ) { | |
function jobhunt_template_job_listing_desc_excerpt() { | |
global $post; | |
$post = get_post( $post ); | |
$excerpt_length = '20'; | |
echo '<p class="job_listing-desc-excert">' . wp_kses_post( wp_trim_words( $post->post_content , $excerpt_length , '...' ) ) . '</p>' ; | |
} | |
} | |
add_action( 'jobhunt_job_listing_title', 'jobhunt_template_job_listing_desc_excerpt', 63 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment