-
-
Save mikejolley/99fef2c01d29cfa3837c to your computer and use it in GitHub Desktop.
A custom job-application.php file
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 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; ?> |
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
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!