Skip to content

Instantly share code, notes, and snippets.

@braddalton
Last active April 1, 2018 14:04
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 braddalton/abe7cbe26f59f47c4cfe02fbc602fd08 to your computer and use it in GitHub Desktop.
Save braddalton/abe7cbe26f59f47c4cfe02fbc602fd08 to your computer and use it in GitHub Desktop.
Add Button With Unique Link To Entries On Archive Pages https://wp.me/p1lTu0-hqu
add_action( 'genesis_entry_content', 'add_button_after_archive_entry', 15 );
function add_button_after_archive_entry() {
if ( ! is_single() && genesis_get_custom_field( 'link' ) )
printf( '<a class="button" href="%s">' . __( 'Buy Now' ) . '</a>', genesis_get_custom_field( 'link' ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment