Hi there,
glad to hear you’re enjoying the theme π
I think the easiest solution would be to create a shortcode instead of using the template tag. Try this PHP snippet:
add_shortcode( 'hero-button', function() {
// Get your url and label
$url = get_post_meta( get_the_ID(), 'hero-button-url', true );
$label = get_post_meta( get_the_ID(), 'hero-button-text', true );
// Output Button if label is complete
if ( $label ) {
ob_start();
printf('<a class="button" href="%1$s">%2$s</a>',esc_url( $url ),$label);
return ob_get_clean();
}
});
Then add [hero-button]
to your hero