Featured image not showing up with video format selected

Posted in: Newsmag
Post count: 7

Hi again,

I would like to display the featured image on top of my “video” articles (I selected video on the right “Format” toolbox between “default” and “video”) with default post template.

The featured image actually shows up only in default format, but doesn’t show with the video format, and on any post template.

Any way to go around this ?

Thanks

Post count: 6535

Hi

Please contact your host and make sure that php multibyte module is installed and activated – http://php.net/manual/en/mbstring.installation.php
Let us know how it goes and if the problem persist please send us an email at contact@tagdiv.com with your login credentials and ftp login details for your server so we can inspect this issue, also include a link to this topic.

Thanks!

Post count: 7

This is what I get when I do a phpinfo(); on my server:

Seems activated. What do you think the problem would be ?

Thanks!

Post count: 7909

Hi,

Please send an email at contact@tagdiv.com and provide wp-admin access and ftp/cpanel access so we can take a closer look at this. Also you can ask your host about this maybe he has an idea about some settings on your server that may block the image download and check the errorlog file. Let us know!

Thanks!

Post count: 7

Hi,

From the code of the theme, it seems that the featured image isn’t supposed to display anyway.
Tell me if I’m mistaken but this would be the code that handles the featured image :

[Newsmag\includes\wp_booster\td_module_single_base.php]

line 109:

        //handle video post format
        if (get_post_format($this->post->ID) == 'video') {
            //if it's a video post...
            $td_post_video = get_post_meta($this->post->ID, 'td_post_video', true);

            //render the video if the post has a video in the featured video section of the post
            if (!empty($td_post_video['td_video'])) {
                return td_video_support::render_video($td_post_video['td_video']);
            }
        } else {
            //if it's a normal post, show the default thumb

            if (!is_null($this->post_thumb_id)) {
                //get the featured image id + full info about the 640px wide one
                $featured_image_id = get_post_thumbnail_id($this->post->ID);
                $featured_image_info = td_util::attachment_get_full_info($featured_image_id, $thumbType);

                //get the full size for the popup
                $featured_image_full_size_src = td_util::attachment_get_src($featured_image_id, 'full');

                $buffy = '';

                $show_td_modal_image = td_util::get_option('tds_featured_image_view_setting') ;

                if (is_single()) {
                    if ($show_td_modal_image != 'no_modal') {
                        //wrap the image_html with a link + add td-modal-image class
                        $image_html = '<a href="' . $featured_image_full_size_src['src'] . '">';
                        $image_html .= '<img width="' . $featured_image_info['width'] . '" height="' . $featured_image_info['height'] . '" src="' . $featured_image_info['src'] . '" alt="' . $featured_image_info['alt']  . '" />';
                        $image_html .= '</a>';
                    } else { //no_modal
                        $image_html = '<img width="' . $featured_image_info['width'] . '" height="' . $featured_image_info['height'] . '" src="' . $featured_image_info['src'] . '" alt="' . $featured_image_info['alt']  . '" />';
                    }
                } else {
                    //on blog index page
                    $image_html = '<a>href . '"><img width="' . $featured_image_info['width'] . '" height="' . $featured_image_info['height'] . '" src="' . $featured_image_info['src'] . '" alt="' . $featured_image_info['alt']  . '" /></a>';
                }

                $buffy .= '<div class="td-post-featured-image">';

                // caption - put html5 wrapper on when we have a caption
                if (!empty($featured_image_info['caption'])) {
                    $buffy .= '<figure>';
                    $buffy .= $image_html;

                    $buffy .= '<figcaption class="wp-caption-text">' . $featured_image_info['caption'] . '</figcaption>';
                    $buffy .= '</figure>';
                } else {
                    $buffy .= $image_html;
                }

                $buffy .= '</div>';

                return $buffy;
            } else {
                return ''; //the post has no thumb
            }
        }

I don’t think the problem comes from my server, because the image tag isn’t generated.
I have to modifiy this code if I want to have the featured image show while in video format.

Thanks

  • This reply was modified 10 years by mikedo7.
  • This reply was modified 10 years by mikedo7.
Post count: 7

Okay, changing the first lines of the code to that seems to do the job and I can get the featured image in video format posts.

//handle video post format
if (get_post_format($this->post->ID) == 'video') {
//if it's a video post...
$td_post_video = get_post_meta($this->post->ID, 'td_post_video', true);
}
//render the video if the post has a video in the featured video section of the post
if (!empty($td_post_video['td_video'])) {
return td_video_support::render_video($td_post_video['td_video']);
} else {

//if it's a normal post, show the default thumb

if (!is_null($this->post_thumb_id)) {
//get the featured image id + full info about the 640px wide one
$featured_image_id = get_post_thumbnail_id($this->post->ID);
$featured_image_info = td_util::attachment_get_full_info($featured_image_id, $thumbType);

//get the full size for the popup
$featured_image_full_size_src = td_util::attachment_get_src($featured_image_id, 'full');

$buffy = '';

$show_td_modal_image = td_util::get_option('tds_featured_image_view_setting') ;

if (is_single()) {
if ($show_td_modal_image != 'no_modal') {
//wrap the image_html with a link + add td-modal-image class
$image_html = '';
$image_html .= '' . $featured_image_info['alt']  . '';
$image_html .= '
';
} else { //no_modal
$image_html = '' . $featured_image_info['alt']  . '';
}
} else {
//on blog index page
$image_html = 'href . '">' . $featured_image_info['alt']  . '';
}

$buffy .= '<div class="td-post-featured-image">';

// caption - put html5 wrapper on when we have a caption
if (!empty($featured_image_info['caption'])) {
$buffy .= '<figure>';
$buffy .= $image_html;

$buffy .= '<figcaption class="wp-caption-text">' . $featured_image_info['caption'] . '</figcaption>';
$buffy .= '</figure>';
} else {
$buffy .= $image_html;
}

$buffy .= '</div>';

return $buffy;
} else {
return ''; //the post has no thumb
}
}

Post count: 6535

Hi

Sorry for the late reply and for misunderstanding you.
Indeed the theme wasn’t designed to display any featured image on video post format, it display only the video set as featured video.
If you still need assistance on this please provide the entire code from td_module_single_base.php file via http://pastebin.com/ so we can have a closer look at the modification that you’ve made. The forum affect the code format and can’t be interpreted properly.
We will inspect this and will get back to you in shortest time possible.

Thanks for your understanding!

Post count: 171

Hi, Andre.

I’m also interested in this.

I want to use the video format due to the “play” icon outside the article (visible on homepage and categories), but at the same time display the featured image inside the video post and embed the code manually where I want. It would be really useful if we can set the video format and if not video is set in the right menu, the theme displays the featured image we uploaded.

Is that possible?

Thanx in advance.

  • This reply was modified 9 years by Arved007.
Post count: 6535

Hi

This is a complex task which involve many customization and tests in order to be achieved.
We can’t offer customization services at the moment so if really need this and you’re not aware of the steps you need to take in this regard please consider hiring a developer or a freelancer to do this for you.

Thanks for your understanding!

Viewing 9 posts - 1 through 9 (of 9 total)
The forum ‘Newsmag’ is closed to new topics and replies.