marcodeltongo / thematic

Automatically exported from code.google.com/p/thematic
0 stars 0 forks source link

Errors in <body> tag #120

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Thematic version: 0.9.7.7 
Viewing on Windows 7. 

In Chrome (latest version: 15), with debugging set to 'true', the body tag 
looks like this:

<body class="<br />
<b>Notice</b>:  Undefined offset:  1 in 
<b>/usr/local/psa/home/vhosts/digitalblonde.co.uk/httpdocs/hamid/wp-content/them
es/thematic/library/extensions/dynamic-classes.php</b> on line <b>335</b><br />
wordpress blogid-1 y2011 m10 d30 h19 home blog not-singular windows chrome ch">

A possibly related problem is that trying to add 'onload' to the body tag thus 
...

//code from themeshaper.com/forums/topic/adding-an-onload-to-the-body-tag
function add_body_onload($c) {
    $c[] = '" onload="ResetScrollPosition();';
    return $c;
}
add_filter('thematic_body_class', 'add_body_onload');

... ends up inserting the 'onload' in the middle of the classes string. I'm 
using FireFox (latest version: 7) here to avoid the above 'Undefined offset' 
error:

<body class="wordpress blogid-1 y2011 m10 d30 h20 home singular slug-home page 
pageid-13 page-author-helennm page-comments-open page-pings-open page-template 
page-template-helen-template-php " onload="ResetScrollPosition(); windows 
firefox ff7">

Original issue reported on code.google.com by helennat...@gmail.com on 30 Oct 2011 at 8:12

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I believe that this was fixed in  issue 117 ? 

Either update thematic to the latest SVN version or add 

define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

in your wp-config.php until the new version is released. This will log errors 
in a file and not output them directly, breaking the page.

Your other problem comes from some other function that is using 
thematic_body_class filter to add body classes after your function closed the 
attribute. Add a priority to your filter to make sure it is fired last of all, 
i.e.
add_filter('thematic_body_class', 'add_body_onload', 99);

Original comment by invistr...@gmail.com on 4 Nov 2011 at 11:46

GoogleCodeExporter commented 9 years ago
Yep I believe the undefined offsets in the default thematic body classes have 
been corrected.

Original comment by eugene.m...@gmail.com on 17 Jan 2012 at 2:55