• Hello,

    My site has lots of embeded videos from Youtube.

    I installed the plugin and it works very well on desktops.

    However, I don´t see (neither “Google Speed my test” or “Pingdom”) any differences in the mobile devices. I read what is written in FAQ´s and I added the code that is there in my theme (“Newspaper”), as “Custom HTML”.

    My questions are:

    1- did I do right? I mean, I must add that code as “Code HTML”, right?

    2- if “yes”, why the plugin doesn´t work on mobile devices?

    Thank you.

    Best regards.

Viewing 3 replies - 16 through 18 (of 18 total)
  • Plugin Author Frank Goossens

    (@futtta)

    well there’s no filter there ..

    the only way we can hook WP YouTube Lyte in there, is if they add an apply_filters in td_module_single_base.php on line 115 to allow us to override the default rendering and to do the return on a next line, so something like;

    if (!empty($td_post_video['td_video'])) {
        $renderedVid = td_video_support::render_video($td_post_video['td_video']);
        $renderedVid = apply_filters('td_filter_video_render',$renderedVid);
        return $renderedVid;
    }

    if that’s there we could change the default rendered video (which has a youtube-frame) with a LYTE video.

    frank

    Thread Starter pedromiguelmoreira

    (@pedromiguelmoreira)

    Well, I need help, because I´m not a programmer…

    In the file in question and in the part that I think that is related to this issue, it is written:


    /**
    * v3 23 ian 2015
    * @param $thumbType
    * @return string
    */
    function get_image($thumbType, $css_image = false) {
    global $page;

    // if ( //check to see if the current single template is configured to show the featured image on the second page
    // !isset( td_global::$single_templates_list[td_global::$cur_single_template][‘show_featured_image_on_all_pages’] )
    // or td_global::$single_templates_list[td_global::$cur_single_template][‘show_featured_image_on_all_pages’] === false
    // ){

    if (td_api_single_template::_check_show_featured_image_on_all_pages(td_global::$cur_single_template) === false) {
    //the post is configured to show the featured image only on the first page
    if (!empty($page) and $page > 1) {
    return ”;
    }
    }

    //do not show the featured image if the global setting is set to hide – show the video preview regardless of the setting
    if (td_util::get_option(‘tds_show_featured_image’) == ‘hide’ and get_post_format($this->post->ID) != ‘video’) {
    return ”;
    }

    //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);

    //retina image
    $srcset_sizes = td_util::get_srcset_sizes($featured_image_id, $thumbType, $featured_image_info[‘width’], $featured_image_info[‘src’]);

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

    So, can you please add the code that you mentioned previously in this translated part?

    Thanks.

    Plugin Author Frank Goossens

    (@futtta)

    the theme-dev really needs to do that, any change you do would risk crashing your site and would anyhow get overwritten by theme updates.

Viewing 3 replies - 16 through 18 (of 18 total)

The topic ‘Plugin in Mobile devices’ is closed to new replies.