Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

YCressant on "WordPress 3.6 Javascript code remains after template_redirect"

$
0
0

The purpose is to produce an ical feed from a plugin

With a simple template_redirect, it was possible until WordPress 3.5.2

After migration to WordPress 3.6, some javascript code remains before de content like this

<!--[if IE 8]>
    <script type="text/javascript">
        (function($) {
            var imgs, i, w;
            var imgs = document.getElementsByTagName( 'img' );
            maxwidth = 0.98 * $( '.entry-content' ).width();
            for( i = 0; i < imgs.length; i++ ) {
                w = imgs[i].getAttribute( 'width' );
                if ( w > maxwidth ) {
                    imgs[i].removeAttribute( 'width' );
                    imgs[i].removeAttribute( 'height' );
                }
            }
        })(jQuery);
    </script>
    <![endif]-->

<script type="text/javascript">
jQuery(document).ready(function($) {
	$("#rotator").cycle({
	    fx: 'cover',
	    timeout: 12000,
	    speed: 2000,
	    pause: 1,
	    fit: 1
	});
});
</script>

[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]


Viewing all articles
Browse latest Browse all 8245

Trending Articles