Disable video and replace with thumbnail on posts page

I have mostly video posts on my blog and I’d like to remove the actual video from the posts page and just use the featured image with a link to the post, like standard posts do. I use video posts because that is what I want on the actual post page. But all those videos on my posts page are slowing down the load time, it also looks sloppy. Here is my
posts page: https://update.breakup.expert/blog/

I installed the Video Thumbnails plugin hoping it would do that but it doesn’t. Please tell me how to disable the video on the posts page but keep it on the individual post page.

Hello @DonnaBarnes,

Thanks for posting in!

To display the featured images in the posts page and the featured video in the single blog post page requires template modification. And because what you are trying to accomplish requires a template customization, we would highly to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released.

Once you have your child theme active and ready, please follow the following steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file

<?php

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

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

  <?php if ( is_single() ) : ?>
    <div class="entry-featured">
      <?php x_featured_video(); ?>
    </div>
  <?php else : ?>
    <div class="entry-featured">
      <?php x_featured_image(); ?>
    </div>
  <?php endif; ?>

  <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>

3] Save the file named as content-video.php
4] Upload this file to your server in the child theme’s folder wp-content/themes/pro-child/framework/views/integrity/

You will need to create this folder path because it does not exist yet in your child theme.

We would loved to know if this has work for you. Thank you.

Thanks so much for your quick and detailed reply. I did exactly as you said but it didn’t work.

Are there any settings I need to adjust to make it work?

Hey Donna,

The instruction Ruenel provide will work and there’s no adjustments needed. See https://youtu.be/_oI0619h6D4. There might have been a step that was done incorrectly. Please review.

Thanks.

I did exactly that but it still doesn’t work for me. Mine has an encoding option. Is utf-8 correct? Below is a screenshot of the file I added. Do I need to do something to the file in parent theme to override it?

Do I need to select a Documentation in the screenshot below?

Well, I went ahead and changed the file in the parent theme and that worked. So I’m not sure why the child theme didn’t work but I thank you for all your help.

I checked your site and you’re not using the child theme. Please make sure you activate the child theme like in the screencast.

Thanks.

Thanks! The option to activate it was hard to find. Usually when you click “Network Enable” the option to activate comes up so since it didn’t I didn’t realize it had to be activated under Appearance — themes. That worked!

Thanks again for all your great help!

On behalf of my colleague, you’re welcome. Cheers! :slight_smile:

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