• Resolved bluntelk

    (@bluntelk)


    Hi all,

    This plugin was stopping the w3c validator from validating our page, so here is a patch to make that work:

    Index: wp-youtube-list-channel.php
    ===================================================================
    — wp-youtube-list-channel.php (revision 4077)
    +++ wp-youtube-list-channel.php (working copy)
    @@ -59,7 +59,7 @@
    }
    $videoDisplay = ”;

    – $videoDisplay .= ‘<script type=”text/javascript”>
    + $videoDisplay .= ‘<script type=”text/javascript”><!–
    function wp_youtube_gallery_post_page(data) {
    var feed = data.feed;
    var entries = feed.entry || [];
    @@ -85,12 +85,12 @@
    }
    document.getElementById(\’videos_on_post_’.$post->ID.’\’).innerHTML = html.join(\’\’);
    }
    – </script>
    + –></script>
    <div id=”videos_on_post_’.$post->ID.'”> <!– The wp_youtube_gallery_post_page() JavaScript function places the YouTube video code here –>
    </div>
    <script
    type=”text/javascript”
    – src=”http://gdata.youtube.com/feeds/users/&#8217;.$channelname.’/uploads?alt=json-in-script&max-results=’.$numvideos.’&callback=wp_youtube_gallery_post_page”>
    + src=”http://gdata.youtube.com/feeds/users/&#8217;.$channelname.’/uploads?alt=json-in-script&max-results=’.$numvideos.’&callback=wp_youtube_gallery_post_page”>
    </script>’;

    return $videoDisplay;
    @@ -218,4 +218,4 @@
    echo $after_widget;
    }
    }
    -?>
    \ No newline at end of file
    +?>

    http://ww.wp.xz.cn/extend/plugins/wp-youtube-channel-gallery/

Viewing 1 replies (of 1 total)
  • Hello,

    Another way to make this validate is to replace the Amperstands in the URL with $ amp ; code (without spaces,) by editing the file wp-youtube-channel-gallery/wp-youtube-list-channel.php on line 93.
    To do this in the admin panel, goto the plugin editor and open the file wp-youtube-list-channel.php.
    Find:
    src="http://gdata.youtube.com/feeds/users/'.$channelname.'/uploads?alt=json-in-script&max-results='.$numvideos.'&callback=wp_youtube_gallery_post_page">
    And replace with:
    src="http://gdata.youtube.com/feeds/users/'.$channelname.'/uploads?alt=json-in-script& amp;max-results='.$numvideos.'& amp;callback=wp_youtube_gallery_post_page">
    Remove the two spaces between & and ; then Save the file, and check your validator again. 🙂
    Note: If this plugin is ever updated that edit will go away and you will have to redo it. So the addition above would probably help more.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: WP Youtube channel gallery] W3C Validation patch’ is closed to new replies.