Hi,
Add the code below to your child theme functions.php
/* POST DOWNLOAD
================================================== */
if ( ! function_exists( 'sf_post_download' ) ) {
function sf_post_download() {
global $post;
$download_button = sf_get_post_meta( $post->ID, 'sf_download_button', true );
$download_file = sf_get_post_meta( $post->ID, 'sf_download_file', true );
$download_text = apply_filters( 'sf_post_download_text', __( "Download", "swiftframework" ) );
$download_shortcode = sf_get_post_meta( $post->ID, 'sf_download_shortcode', true );
if ( $download_button ) {
?>
<div class="post-download">
<?php if ( $download_shortcode != "" ) {
echo do_shortcode( $download_shortcode );
} else {
?>
<a href="<?php echo wp_get_attachment_url( $download_file ); ?>"
class="sf-button accent" target="_blank"><?php echo $download_text; ?></a>
<?php } ?>
</div>
<?php
}
}
}
-Rui