Forums

WP Youtube channel gallery
[resolved] W3C Validation patch (2 posts)

  1. bluntelk
    Member
    Posted 1 year ago #

    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/'.$channelname.'/uploads?alt=json-in-script&max-results='.$numvideos.'&callback=wp_youtube_gallery_post_page">
    + src="http://gdata.youtube.com/feeds/users/'.$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://wordpress.org/extend/plugins/wp-youtube-channel-gallery/

  2. cynixx3
    Member
    Posted 4 months ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic