Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   New Versions, & Updating (http://forum.bytesforall.com/forumdisplay.php?f=12)
-   -   Validation error with new widget in footer (http://forum.bytesforall.com/showthread.php?t=16304)

tracytrends Dec 19, 2011 05:36 PM

Validation error with new widget in footer
 
I was able to enter the code for a custom footer and it validated after removing the lines Katy suggested, but only when the widget is empty.

If I fill the widget with a text box, it no longer validates. (I just upgraded but had this issue in 3.7.1 too)

It has something to do with the slashes and how the textwidget is being read. I'm new to WP, atahualpa, css, and php.

Here are the W3C errors:

Line 370, Column 61: an attribute value must be a literal unless it contains only name characters

…_2" align="left" valign="top"><div id=\"text-18\" class=\"header-widget widget…✉

You have used a character that is not considered a "name character" in an attribute value. Which characters are considered "name characters" varies between the different document types, but a good rule of thumb is that unless the value contains only lower or upper case letters in the range a-z you must put quotation marks around the value. In fact, unless you have extreme file size requirements it is a very very good idea to always put quote marks around your attribute values. It is never wrong to do so, and very often it is absolutely necessary.

Line 370, Column 61: character "\" is not allowed in the value of attribute "id"

…_2" align="left" valign="top"><div id=\"text-18\" class=\"header-widget widget…✉

It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.

Line 370, Column 79: an attribute value must be a literal unless it contains only name characters

…align="top"><div id=\"text-18\" class=\"header-widget widget_text\">

<div cl…✉
You have used a character that is not considered a "name character" in an attribute value. Which characters are considered "name characters" varies between the different document types, but a good rule of thumb is that unless the value contains only lower or upper case letters in the range a-z you must put quotation marks around the value. In fact, unless you have extreme file size requirements it is a very very good idea to always put quote marks around your attribute values. It is never wrong to do so, and very often it is absolutely necessary.

Line 370, Column 106: "widget_text" is not a member of a group specified for any attribute

…-18\" class=\"header-widget widget_text\"> <div class="textwidget">test</div>



This is what I have in my footer area:

HTML Code:

<?php bfa_widget_area('name=My widget area&cells=4&align=1&align_2=9&align_3=7&width_4=700&before_widget=<div id="%1$s" class="header-widget %2$s">&after_widget=</div>'); ?>

Copyright &copy; %current-year% %home% - All Rights Reserved


If you could shed some ideas, I appreciate your time,
Tracy

juggledad Dec 19, 2011 06:32 PM

my guess is that the change you made messed something up or when the site is passed to the validator it trys to ecape the " with a \ or something. Without having the url of the site it is hadr to tell

tracytrends Dec 20, 2011 05:00 AM

Thank you for trying to help. Here is a clean page (no errors except the footer test box)

http://www.kidsandmoneytoday.com/privacy-policy/

When you say 'the change you made,' I assume this means adding the footer and deleting the 'p' line references.

I know when we add/delete things sometimes coding snips are left behind, so if I need to somehow reset, I can do that. If I reset by deleting all footer coding (ATO>style & edit footer) & delete all corresponding widgets (ATO>add new widget areas), the page validates. When I re-add footer coding and removed four 'p' line references, the page validates. But when I drag a widget into the newly created footer widget box (appearance>widgets), the 4 errors show up (per widget area).

The errors show red slashes in these parts of the coding from my original post: id=\ (first two errors) and class=\ and text\" .

Thank you again for trying to help. Another idea I had was to just put a table in the footer area (ATO>style&edit footer), but the validator did not like my basic html in that location, and of course this is less flexible for quick changes.

Tracy

juggledad Dec 20, 2011 05:35 AM

Please go to ato->export/import settings and export your settings and attach them to a reply (the paper clip icon)

what happens if you shut off all plugins?

tracytrends Dec 20, 2011 07:57 AM

1 Attachment(s)
Same 4 errors with plugins deactivated.

Trying file attach again. Just incase, I also uploaded it here:

http://www.tracytrends.com/ata-wwwki...m-20111220.txt

thanks for your patience,
Tracy

juggledad Dec 20, 2011 08:00 AM

What widget did you put in it and what is the exact info you put in the widget?

tracytrends Dec 20, 2011 08:24 AM

I dragged and dropped a text widget into 'my widget area 1' and entered/typed 'test box' for the title and 'test' in the content area.

You can visually see it on the left of my footer area in the sample page.

Tracy

tracytrends Dec 20, 2011 08:58 AM

updated below...

juggledad Dec 20, 2011 11:29 AM

It has to be something in your environment. I copied the widget code into a site, add a text widget and the resultant HTML does not have the backslash that shows up at your site.

juggledad Dec 20, 2011 11:54 AM

I see the backslah is gone, so what did you do?

tracytrends Dec 20, 2011 12:36 PM

I began reducing all coding to basics. Currently I have in my footer content:

<?php bfa_widget_area('name=Mywidget4cells=4&align=9'); ?>

followed by a single cell footer widget using the core basic coding provided in the theme

<?php bfa_widget_area('name=single footer cell widget'); ?>

Both validate after dragging in text boxes. The error must be connected to the width and alignment settings, but this solves it enough for right now (until I desire different column widths).

Thank you again for taking time to try and help. It gave me the idea to go back to basics (and to closely read and attempt to understand the theme notes).

Have a great holiday,
Tracy

juggledad Apr 14, 2012 12:48 PM

the backslash's in the code are caused by the PHP option 'magic_quotes_gpc' being set to 'on'.
you need to edit the php.ini and add
HTML Code:

magic_quotes_gpc = off


All times are GMT -6. The time now is 01:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.