Skip to content

Instantly share code, notes, and snippets.

@tripflex
Created June 4, 2015 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/b3dbbc80c75ed488506e to your computer and use it in GitHub Desktop.
Save tripflex/b3dbbc80c75ed488506e to your computer and use it in GitHub Desktop.
Example of adding custom PHP field output on Job List page
<?php global $post; ?>
<li <?php job_listing_class(); ?> data-longitude="<?php echo esc_attr( $post->geolocation_lat ); ?>" data-latitude="<?php echo esc_attr( $post->geolocation_long ); ?>">
<a href="<?php the_job_permalink(); ?>">
<?php the_company_logo(); ?>
<div class="position">
<!-- This is the Job Title -->
<h3><?php the_title(); ?></h3>
<div class="company">
<?php the_company_name( '<strong>', '</strong> ' ); ?>
<?php the_company_tagline( '<span class="tagline">', '</span>' ); ?>
</div>
</div>
<div class="other-details">
<?php the_custom_field( 'job_rate_hours' ); ?>
<?php the_custom_field( 'job_details' ); ?>
<?php the_custom_field( 'job_contact' ); ?>
</div>
<div class="location">
<?php the_job_location( false ); ?>
</div>
<ul class="meta">
<?php do_action( 'job_listing_meta_start' ); ?>
<li class="job-type <?php echo get_the_job_type() ? sanitize_title( get_the_job_type()->slug ) : ''; ?>"><?php the_job_type(); ?></li>
<li class="date"><date><?php printf( __( '%s ago', 'wp-job-manager' ), human_time_diff( get_post_time( 'U' ), current_time( 'timestamp' ) ) ); ?></date></li>
<?php do_action( 'job_listing_meta_end' ); ?>
</ul>
</a>
</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment