WordPress.org

Support

Support » Plugins and Hacks » Featured Video Plus » [Resolved] How to replace featured image ONLY on post page

[Resolved] How to replace featured image ONLY on post page

Viewing 2 replies - 1 through 2 (of 2 total)
  • I managed to figure this out. This is what I did

    In settings > media. I chose the usage option (None of the above: Manually use PHP-functions or shortcodes) for featured video plus.

    Then I went into appearance > editor and found the php file that displays my single posts. For me it was single.php

    I found the place where it inserts my featured image and wrapped it in conditional tags.

    if ( has_post_video() ) {
        the_post_video();
    } elseif ( has_post_thumbnail() ) {
    	the_post_thumbnail();
     }
     ?>

    How it looks in my theme

    <?php
    if ( has_post_video() ) {
        the_post_video();
    } elseif ( has_post_thumbnail() ) {
       $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
       echo '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '">';
       the_post_thumbnail('full');
       echo '</a>';
     }
     ?>

    Thanks so much. This helped me resolve my issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] How to replace featured image ONLY on post page’ is closed to new replies.
Skip to toolbar