Support » Plugins » Pages Widget Validation Error with Kubrik theme

  • Resolved ptp


    I’m loving the Sidebar Widgets plugin. I have only one problem, when I check for validation (the link for which isn’t in the Meta when using a customized Sidebar anymore) I get the following validation error:

    Line 168, column 30: an attribute value must be a literal unless it contains only name characters .

    <li class="pagenav"><h2 class="widgettitle">Pages</h2>

    I’ve changed the order around to see if it was just a bug with the combination I had, I’ve removed all the other widgets, and still get the error, though the line changes around some. I’ve also tried with a custom title and without, with no difference.

    My blog is up at:
    A link to the validation of that blog is: Validation of Pneumonochrome

    Any ideas what I can do to fix this?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Well it doesn’t throw an error on my page. I use kubrick theme along with sidebar widgets as well.

    You might want to check your sidebar.php file again.

    Hrmmm. Odd. I copied the sidebar file straight out of the plugin zip and haven’t changed a thing…. okay, I’ll keep playing with it.

    Edit: Nothing looks amiss in my sidebar.php file…

    Any other ideas? Does anyone else have validation erros?

    Edit #2: bdsays, it doesn’t look like you have the “Pages” widget on your sidebar, at least, not if the site you’re referring to is the one your name links too. It’s only on the Pages widget that I see this problem. Sorry I didn’t mention that in the first post… I thought I had.

    Okay, after some more fiddling, this is what I’ve found:

    I edited the “widgets.php” plugin file at line 624 as follows:

    I commented out line 624, which was:

    and added the following 3 lines:

    $testarg = $before_title . $title . $after_title;
    echo '<!--' . $testarg . '-->';

    This result in an HTML comment that looks like:

    <!--<h2 class="widgettitle">My Pages</h2>

    and the line that’s causing validation problems:

    <li class="pagenav"><h2 class=\"widgettitle\">My Pages</h2>

    So, it looks like the problematic slash is being inserted by the wp_list_pages() function somehow, as it’s definitely not there in the comment.

    This is, unfortunately, the extent of my ability with PHP. I’m thinking this qualifies as a bug, but I don’t know what to do from here. If anyone knows of an easy way to fix this problem, I’d be very grateful for tips.

    I’m still stuck on this. Has anyone got any idea how I can get rid of those slashes? It looks like somewhere in the wp_list_pages function, the quotes we’re feeding to it are getting escaped (notice that there’s a / before both quotes in the <h2 class="widgettitle"> tag). I’ve examined the function in the wp-post-functions.php file, but I haven’t found anything that jumps out at me. Granted, I don’t understand every bit of code there, but at any rate, I’m stuck. I think I understand most of the code, except I don’t know what __(‘Pages’) is, so I don’t know if that could be where it’s coming from.

    Please help.

    All right,

    It looks like no one is inclined to help. After a lot of research I’ve managed to apply a quick-and-dirty fix to get this validating again, the details are below:

    I replaced line 624 of widgets.php with four lines of code.
    624 was originally:


    Changing it to:

    ob_start ();
    $tempout = ob_get_clean ();
    echo stripslashes($tempout);

    This is obviously quick and dirty, because if there *were* any reason to have backslashes in that line of HTML, it would remove them indiscriminately. I’ve been unable, however, to get the replacement to work using preg_replace or str_replace. So, for anyone else who wants to use the widgets plugin with the Kubrick theme, wants to display their pages section on their dynamic sidebar, and wants their page to validate, the above code change in widgets.php should temporarily fix it.

    Okay, sorry, I’m not really trying to bump this, I’m just trying to make sure that the solutions are here before I give up. After some searching, I found Ticket #2638, which addresses this issue. I’ve applied the code change recommended by the submitter, and it has taken care of the problems I was having in a much narrower scope than my initial fix suggestion. The ticket can be viewed at

    I’m changing this to resolved.

    Where to apply the fix given in the following link:


    I’ve searched all over widgets.php and haven’t found proper lines :(((

    EDIT: I’ve found the proper file:


    sorry for troubling 😉

    Thank you so much for this, I have the same problem, I think it should be included NOW on the widgets default zip.

    The problem lies in the internal Word Press function 🙂 thankfully it was so easy to solve 🙂

    Warning: this bug hasn’t been fixed in WP 2.0.3, so after upgrading you need to apply the changes to wp-includes/template-functions-post.php again. 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Pages Widget Validation Error with Kubrik theme’ is closed to new replies.