• Right now Sermon Manger defaults to video, if you have both an audio version and a video version of the sermon uploaded. We want user to have the option of audio or video. I know it would require a lot more code work to be able to select one or the other so for now we just want to display both audio and video and they can choose which to play. I know it’s an issue with the ifelse statement, but don’t know what to change it to so it will show both. The code snippet is below. Thanks for any help!

    // render files section
    function wpfc_sermon_files() {
    	if ( get_wpfc_sermon_meta('sermon_video') ) {
    		echo '<div id="wpfc_sermon-video" class="cf">';
    			echo do_shortcode( get_wpfc_sermon_meta('sermon_video'));
    		echo '</div>';
    	} ifelse ( !get_wpfc_sermon_meta('sermon_video') && get_wpfc_sermon_meta('sermon_audio') ) {
    		echo '<div id="wpfc_sermon-audio" class="cf">';?>
    			<script>
    				jQuery.noConflict();
    				jQuery(document).ready(function(){
    					jQuery('audio').mediaelementplayer();
    				});
    			</script> <?php
    			echo '<audio controls="controls">';
    				echo '<source src="' . get_wpfc_sermon_meta('sermon_audio') . '"  type="audio/mp3" />';
    			echo '</audio>';
    		echo '</div>';
    	}
Viewing 5 replies - 1 through 5 (of 5 total)
  • Did you work this out?

    I use a shortcode to provide a download link, and because the description bit doesn’t take shortcodes, I’m putting the download link in the video embed section, but I don’t want that to replace the audio.

    Btw, this would work:

    // render files section
    function wpfc_sermon_files() {
    	if ( get_wpfc_sermon_meta('sermon_video') ) {
    		echo '<div class="wpfc_sermon-video cf">';
    			echo do_shortcode( get_wpfc_sermon_meta('sermon_video'));
    		echo '</div>';
    	}
    	if ( get_wpfc_sermon_meta('sermon_audio') ) {
    		echo '<div class="wpfc_sermon-audio cf">';?>
    			<script>
    				jQuery.noConflict();
    				jQuery(document).ready(function(){
    					jQuery('audio').mediaelementplayer();
    				});
    			</script> <?php
    			echo '<audio controls="controls">';
    				echo '<source src="' . get_wpfc_sermon_meta('sermon_audio') . '"  type="audio/mp3" />';
    			echo '</audio>';
    		echo '</div>';
    	}
    	if ( get_wpfc_sermon_meta('sermon_notes') ) {
    		echo '<div class="wpfc_sermon-notes cf">';
    			echo '<a href="' . get_wpfc_sermon_meta('sermon_notes') . '" class="sermon-notes">'.__( 'Notes', 'sermon-manager').'</a>';
    		echo '</div>';
    	}
    }

    Does work, I just tested it on mine.

    Like this plugin but having the same issue – the code you listed above…

    where exactly does that go?

    I’m sorry, it’s been a while since I did that and I’m not able to get onto the site that I did it for anymore – when I return home in a week I will check my backups and see if I can provide you with more detailed information.

    There is possibly a better way to do it though, I just kind of did that as a temporary fix and then stuck with it.

    Josh.

    @thegsides
    includes/template-tags.php line 247

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Sermon Manager] Display Video & Audio…not "elseif"’ is closed to new replies.