Display featured image instead of embedded video

Hello,

I have dozen of posts, which are type of “video”.
On category page, blog page, etc. I would like to display the featured image of the posts (which could be clicable) instead of directly showing the video. The video would only be on the post page.
I coudn’t find how to customize this.

Thanks

Hi Jérôme,

This is possible but you will have to override the default theme file that displays the video items on the blog page.

To do this, please install and activate the child theme. If you do not have the child theme installed yet, you can download it from here. Once you have it installed and activated, please login through FTP then go to wp-content/themes/x-child then go to the following file path framework/views/integrity if any directory is not present yet, you may create the folder until you get to the integrity directory.

Once you’re in the integrity directory, create the file content-video.php then add this code to the file:

<?php

// =============================================================================
// VIEWS/INTEGRITY/CONTENT-VIDEO.PHP
// -----------------------------------------------------------------------------
// Video post output for Integrity.
// =============================================================================

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  <div class="entry-featured">
    <?php x_featured_image(); ?>
  </div>
  <div class="entry-wrap">
    <?php x_get_view( 'integrity', '_content', 'post-header' ); ?>
    <?php x_get_view( 'global', '_content' ); ?>
  </div>
  <?php x_get_view( 'integrity', '_content', 'post-footer' ); ?>
</article>

Kindly note that since this is a custom code that changes the default behavior/display of the theme, you will be responsible to maintain or update the code in case you require further changes or if the code stops working in future updates. If you are uncertain how to proceed, it would be best to get in touch with a developer.

Hope this helps.

Thank you so much !
I’ve tried and the behavior is almost OK

The problem is : I want this override only on pages like category, tag, etc.
But on the post page itself, I want the original behavior (otherwise the video will never show)

Thanks again

Found !

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  <div class="entry-featured">
    <?php if (is_single()) {x_featured_video(); } else {x_featured_image();} ?>
  </div>
  <div class="entry-wrap">
    <?php x_get_view( 'integrity', '_content', 'post-header' ); ?>
    <?php x_get_view( 'global', '_content' ); ?>
  </div>
  <?php x_get_view( 'integrity', '_content', 'post-footer' ); ?>
</article>

Glad you’ve found it.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.