Skip to content

Instantly share code, notes, and snippets.

@rali14
Last active November 30, 2016 17:53
Show Gist options
  • Save rali14/42d1502b4c5aec1609310b20ca1a03b4 to your computer and use it in GitHub Desktop.
Save rali14/42d1502b4c5aec1609310b20ca1a03b4 to your computer and use it in GitHub Desktop.
Display hero button if meta key is not empty
<?php
/**
* Plugin Name: Listify - Custom Single Listing Hero Button
*/
function custom_listify_single_job_listing_actions_after() {
global $post;
$url = get_post_meta( $post->ID, 'your_custom_meta_key', true );
if ($url != "") {
echo '<a href="' . esc_url( $url ) . '" class="button">My Button</a>';
}
}
add_filter( 'listify_single_job_listing_actions_after', 'custom_listify_single_job_listing_actions_after' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment