|
18 | 18 | add_action( 'sermon_single', 'wpfc_sermon_single' );
|
19 | 19 | add_action( 'sermon_excerpt', 'wpfc_sermon_excerpt' );
|
20 | 20 | add_filter( 'the_content', 'add_wpfc_sermon_content' );
|
| 21 | +add_filter( 'the_excerpt', 'add_wpfc_sermon_player' ); |
21 | 22 |
|
22 | 23 | // Include template for displaying sermons
|
23 | 24 | function sermon_template_include( $template ) {
|
@@ -443,13 +444,13 @@ function wpfc_sermon_attachments() {
|
443 | 444 | $html = '<div id="wpfc-attachments" class="cf">';
|
444 | 445 | $html .= '<p><strong>' . __( 'Download Files', 'sermon-manager-for-wordpress' ) . '</strong>';
|
445 | 446 | if ( get_wpfc_sermon_meta( 'sermon_audio' ) ) {
|
446 |
| - $html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_audio' ) . '" class="sermon-attachments" download><span class="dashicons dashicons-media-audio"></span>' . __( 'MP3', 'sermon-manager-for-wordpress' ) . '</a>'; |
| 447 | + $html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_audio' ) . '" class="sermon-attachments" download="' . basename( get_wpfc_sermon_meta( 'sermon_audio' ) ) . '"><span class="dashicons dashicons-media-audio"></span>' . __( 'MP3', 'sermon-manager-for-wordpress' ) . '</a>'; |
447 | 448 | }
|
448 | 449 | if ( get_wpfc_sermon_meta( 'sermon_notes' ) ) {
|
449 |
| - $html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_notes' ) . '" class="sermon-attachments"><span class="dashicons dashicons-media-document"></span>' . __( 'Notes', 'sermon-manager-for-wordpress' ) . '</a>'; |
| 450 | + $html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_notes' ) . '" class="sermon-attachments" download="' . basename( get_wpfc_sermon_meta( 'sermon_notes' ) ) . '"><span class="dashicons dashicons-media-document"></span>' . __( 'Notes', 'sermon-manager-for-wordpress' ) . '</a>'; |
450 | 451 | }
|
451 | 452 | if ( get_wpfc_sermon_meta( 'sermon_bulletin' ) ) {
|
452 |
| - $html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_bulletin' ) . '" class="sermon-attachments"><span class="dashicons dashicons-media-document"></span>' . __( 'Bulletin', 'sermon-manager-for-wordpress' ) . '</a>'; |
| 453 | + $html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_bulletin' ) . '" class="sermon-attachments" download="' . basename( get_wpfc_sermon_meta( 'sermon_bulletin' ) ) . '"><span class="dashicons dashicons-media-document"></span>' . __( 'Bulletin', 'sermon-manager-for-wordpress' ) . '</a>'; |
453 | 454 | }
|
454 | 455 | $html .= '</p>';
|
455 | 456 | $html .= '</div>';
|
@@ -572,6 +573,24 @@ function wpfc_sermon_excerpt( $return = false ) {
|
572 | 573 | return $output;
|
573 | 574 | }
|
574 | 575 |
|
| 576 | +function add_wpfc_sermon_player() { |
| 577 | + $content = ''; |
| 578 | + |
| 579 | + if ( \SermonManager::getOption( 'archive_player' ) || \SermonManager::getOption( 'archive_meta' ) ) { |
| 580 | + $content = '<div class="wpfc_sermon cf">'; |
| 581 | + if ( \SermonManager::getOption( 'archive_player' ) ) { |
| 582 | + $content .= wpfc_sermon_media(); |
| 583 | + } |
| 584 | + if ( \SermonManager::getOption( 'archive_meta' ) ) { |
| 585 | + $content .= wpfc_sermon_attachments(); |
| 586 | + } |
| 587 | + |
| 588 | + $content .= '</div>'; |
| 589 | + } |
| 590 | + |
| 591 | + return $content; |
| 592 | +} |
| 593 | + |
575 | 594 | function add_wpfc_sermon_content( $content ) {
|
576 | 595 | if ( 'wpfc_sermon' == get_post_type() && in_the_loop() == true ) {
|
577 | 596 | if ( ! is_feed() && ( is_archive() || is_search() ) ) {
|
|
0 commit comments