Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

houstonbrooke commented May 22, 2015

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

This comment has been minimized.

Copy link

ProfAdmin commented Sep 28, 2018

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
You can’t perform that action at this time.