Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created May 8, 2014 15:37
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 mikejolley/99fef2c01d29cfa3837c to your computer and use it in GitHub Desktop.
Save mikejolley/99fef2c01d29cfa3837c to your computer and use it in GitHub Desktop.
A custom job-application.php file
<?php if ( $apply = get_the_job_application_method() ) :
if ( $apply->type === 'url' ) {
$application_href = $apply->url;
} elseif ( $apply->type === 'email' ) {
$application_href = sprintf( 'mailto:%1$s%2$s', $apply->email, '?subject=' . rawurlencode( $apply->subject ) );
}
?>
<div class="application">
<a class="application_button button" href="<?php echo $application_href; ?>"><?php _e( 'Apply for job', 'wp-job-manager' ); ?></a>
</div>
<?php endif; ?>
@houstonbrooke
Copy link

Just what I was looking for. However, the button doesn't seem to be showing up, just the text. I thought it was that the class "application_button button" was really just "application_button" and it was missing type="button", but that didn't work.
I'm not a developer by any means, I just know how to follow instructions. :)
Is this code meant to work with the latest job manager version?
Thanks!

@ProfAdmin
Copy link

What would it be a button, I replaced part of the code.
Instead of this:

<div class="application">
<a class="application_button button" href="<?php echo $application_href; ?>"><?php _e( 'Apply for job', 'wp-job-manager' ); ?></a>
</div>

I wrote this:

<div class="application">
<form>
<input class="application_button button" type="button" value="<?php _e( 'Apply for job', 'wp-job-manager' ); ?>" onclick="javascript:window.location='<?php echo $application_href; ?>'"/>
</form>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment