• Hi,

    I’d love to be able to have the download option available when using shortcodes, for examples [sermons], but it only seems to be showing when a single sermon is clicked on.

    Is there shortcode or css that can display this download button when I need it?

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • SM Settings > Display > Display Attachments. The default is unchecked, so check it.

    Thread Starter lauriek

    (@lauriek)

    Thanks, however that provides an attachment link above the player that doesn’t look too great, as opposed to the nice download arrow that forms part of the player when you click on the sermon. Is there a way to display it the same as this? Can send you a link if you’re not getting me!
    Thanks

    Agree with @lauriek that the button shown is not great and doesn’t interpret to a user as download, is there a way to change the button image as a workaround.

    I guess I don’t understand. You don’t see a download icon beside the audio player?

    Can you post an example?

    If you want to change the audio icon, then add this to your custom CSS section:
    .wpfc-sermon .dashicons-media-audio:before {content: "\f316";}

    thanks @hikinmike

    Thread Starter lauriek

    (@lauriek)

    Hi,
    Thanks for the help.
    You can see on this link – https://erskine.church/sermons
    That’s what it looks like with the little attachment icon which is clumsily placed

    But https://erskine.church/sermons-archive/gavins-sermon-test

    It is placed nicely next to the player and with a nice looking icon.

    I’ve used the CSS to change the icon so it looks better, but it’s not in the right place, you can see from the links. is it possible to have it displaying the same as on the single sermons?

    Thanks, appreciate your time.

    If you’re not afraid to get your hands dirty, you can edit the content-sermon-archive.php file. While this isn’t specifically for your issue, this link will help in finding and copying the file you need: https://wpforchurch.com/my/knowledgebase/69/Modifying-the-Excerpt-of-a-Sermon-Archive.html

    So you will need to copy a section from content-sermon-single.php to content-sermon-archive.php.

    When you have your content-sermon-archive.php file open, find this:

    <?php if ( \SermonManager::getOption( 'archive_player' ) ) : ?>
    	<div class="wpfc-sermon-audio">
    		<?php echo wpfc_render_audio( $post->ID ); ?>
    	</div>
    <?php endif; ?>

    Delete that and use this:

    <?php if ( get_wpfc_sermon_meta( 'sermon_audio' ) || get_wpfc_sermon_meta( 'sermon_audio_id' ) ) : ?>
    	<?php
    	$sermon_audio_id     = get_wpfc_sermon_meta( 'sermon_audio_id' );
    	$sermon_audio_url_wp = $sermon_audio_id ? wp_get_attachment_url( intval( $sermon_audio_id ) ) : false;
    	$sermon_audio_url    = $sermon_audio_id && $sermon_audio_url_wp ? $sermon_audio_url_wp : get_wpfc_sermon_meta( 'sermon_audio' );
    	?>
    	<div class="wpfc-sermon-single-audio player-<?php echo strtolower( \SermonManager::getOption( 'player', 'plyr' ) ); ?>">
    		<?php echo wpfc_render_audio( $sermon_audio_url ); ?>
    		<a class="wpfc-sermon-single-audio-download"
    				href="<?php echo $sermon_audio_url; ?>"
    				download="<?php echo basename( $sermon_audio_url ); ?>"
    				title="<?php echo __( 'Download Audio File', 'sermon-manager-for-wordpress' ); ?>">
    			<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24"
    					xmlns="https://www.w3.org/2000/svg">
    				<path d="M0 0h24v24H0z" fill="none"></path>
    				<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"></path>
    			</svg>
    		</a>
    	</div>
    <?php endif; ?>

    I just did this using ‘SeventeenTwenty’ on our testing site and it works fine.

    Thread Starter lauriek

    (@lauriek)

    Thank you! I just tried this and it worked perfectly.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Add Download option to shortcode’ is closed to new replies.