• Resolved jmclean

    (@jmclean)


    On the Sermons page, I am adding the $latest_sermon to display the latest sermon at the top of the archives page, however I need to customize what is displayed a little and I’m not sure why the functions aren’t working.

    1. I would like to make the render_sermon_image() to link to the actual sermon, not the sermon series page. Even better, I’d like to make it link to the video.
    2. I would also like to add the audio player to the latest sermon

    Here is an image of the comp I’m working off of.

    Thanks!

    • This topic was modified 5 years, 10 months ago by jmclean.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’m not a developer, but if you look at the \views\partials\content-sermon-single.php file in the plugin, you should be able to find the info you’re looking for.

    This will display the sermon image with the link:

    <a href="<?php the_permalink(); ?>">
      <img class="wpfc-sermon-single-image-img" alt="<?php the_title(); ?>"	src="<?php echo get_sermon_image_url(); ?>">
    </a>

    If you figure this out, would you be able to share your findings? I’m very much interested in doing something similar

    • This reply was modified 5 years, 10 months ago by makinde.
    Thread Starter jmclean

    (@jmclean)

    Hi Mike,

    Thanks, that worked for linking the image to the actual sermon.

    I’m still interested in getting the audio player to display there.

    Thanks!

    I’m using this in our custom single sermon page, but using this in the archive page works as well.

    <div class="entry-audio">
    
      <?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 = $sermon_audio_id ? wp_get_attachment_url( intval( $sermon_audio_id ) ) : get_wpfc_sermon_meta( 'sermon_audio' );
        
      ?>
      
      <div class="sermon-single-audio player-<?php echo strtolower( \SermonManager::getOption( 'player', 'plyr' ) ); ?>">
      
        <?php echo wpfc_render_audio( $sermon_audio_url ); ?>
        
        <a class="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="http://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><!-- .sermon-single-audio -->
      
    <?php endif; ?>	
    
    </div><!-- .entry-audio -->

    Like I mentioned earlier, all of the code can be found in the plugin’s \views\partials\content-sermon-single.php file.

    Thread Starter jmclean

    (@jmclean)

    Ah, thank you kind sir! That worked beautifully!

    Ah, thank you kind sir! That worked beautifully!

    Glad it worked for you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Latest Sermon Image & Audio’ is closed to new replies.