Tips and Tricks HQ Support Portal › Forums › WP eMember › W3C Validation Error = div not allowed in header
- This topic has 5 replies, 2 voices, and was last updated 13 years, 2 months ago by admin.
-
AuthorPosts
-
September 18, 2011 at 10:57 pm #4350vfontjrMember
Hi,
In trying to improve my search engine rankings, I ran my site through woorank. WP_eMember produces a W3C Validation Error for the following code:
<div class=”emember_modal” id=”prompt”>
<h2>Password Reset</h2>
<div id=”wp_emember_email_mailMsg”></div>
<div id=”wp_emember_email_mailForm”>
Please enter your e-mail address. You will receive a new password via e-mail. <form action=”javascript:void(0);” method=”post” name=”wp_emember_mailSendForm” id=”wp_emember_mailSendForm” >
<p class=”textbox”>
<label for=”wp_emember_email” class=”eMember_label”>Email: </label>
<input class=”eMember_text_input” type=”text” id=”wp_emember_email” name=”wp_emember_email” size=”20″ value=”” />
<input class=”eMember_text_input” type=”hidden” id=”event” name=”event” size=”20″ value=”send_mail” />
</p>
<p>
<input name=”wp_emember_email_doSend” type=”submit” id=”wp_emember_email_doSend” class=”emember_button” value=”Reset” />
<input type=”button” class=”close emember_button” value=”Close” />
</p>
</form>
</div>
</div>
Div elements are not allowed in the header. Is it possible to load the div element into the footer so there are no errors produced that will impact search engine ranking. This one will for sure.
September 19, 2011 at 1:55 am #36756adminKeymasterokay.. will work on moving that div down in the body content. Should be able to give you an update in a day or two.
September 24, 2011 at 2:48 am #36757vfontjrMemberI fixed all the W3C validation errors myself. There are also two errors and 2 warnings from WP eStore.
For WP eMember, the problems are fixed by changing the following line of code in wp_emember1.php: add_filter(‘wp_head’, ‘wp_emember_hook_password_reminder’); to
add_filter(‘wp_footer’, ‘wp_emember_hook_password_reminder’);.
From what I tested, everything works fine.
Wp eStore fails to validate because of unescaped ampersands in the comment of a Javascript function. The fix for WP eStore is to edit eStore_includes.php and change the two occurances of T&C to T and C.
These two fixes correct all 7 validation errors and 2 warnings attributed to these two plugins. They now pass W3C validation with flying colors and will no longer negatively influence search engine rankings.
September 24, 2011 at 3:17 am #36758adminKeymasterWhat you did is correct. We also updated the plugins to handle this (slightly differently though). Adding those to the footer is the right call to make but unfortunately there are too many theme developers out there without proper WordPress stucture knowledge and they don’t add the footer call in the theme. This is makes it to where the “wp_footer” action hook never gets fired and nothing works. More details here:
September 24, 2011 at 3:46 am #36759vfontjrMemberI understand your viewpoint. It’s been awhile since I coded a commercial product for general distribution and I forget sometimes the requirements you need to consider. I’m using the Genesis framework which is very well constructed and adheres to proper WordPress structure. As an affiliate, I plan to aggressively market your plugins on my consulting site. I’ve also posted about how great they are and how good your support is on the Studiopress site. (Makers of Genesis)
September 24, 2011 at 7:32 am #36760adminKeymasterThank you
-
AuthorPosts
- You must be logged in to reply to this topic.