Home User profile
tagDiv Member
This user did not write anything. So we are just showing here some random text to make the profile page look nice :)
mikedo7
tagDiv Member

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

mikedo7
tagDiv Member

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.
mikedo7
tagDiv Member

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

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

Thanks!

mikedo7
tagDiv Member

Ok I seemed to have found the issue, I had these lines in my functions.php within my child theme:

if (!defined(‘TD_THEME_WP_BOOSTER’)) {
include TEMPLATEPATH . ‘/includes/td_config.php’;
include TEMPLATEPATH . ‘/includes/wp_booster/td_wp_booster_functions.php’;
}

Removing them seems to work out fine. Will let you know if I have any further issue.

Thanks

mikedo7
tagDiv Member

No, actually once I use the new version I cannot navigate anymore through the WP admin panel.
Can I update the plugins first ?

edit: I’m only using the Visual Composer plugin, the Revolution slider and tagDiv social counter are deactivated

  • This reply was modified 10 years by mikedo7.
Viewing 5 posts - 1 through 5 (of 5 total)