Title: W3C validator problems
Last modified: August 22, 2016

---

# W3C validator problems

 *  [Contortion](https://wordpress.org/support/users/contortion/)
 * (@contortion)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/w3c-validator-problems/)
 * If I validate my blog without your widget added I get a 100% pass. If I then 
   activate your widget I get 3 errors. Please don’t ask me for a link to my site,
   try it yourself on your own. Deactivate the widget, check W3C validator and then
   reactivate it and try W3C validator then you will see.
 * [https://wordpress.org/plugins/links-with-icons-widget/](https://wordpress.org/plugins/links-with-icons-widget/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [Contortion](https://wordpress.org/support/users/contortion/)
 * (@contortion)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/w3c-validator-problems/#post-5598969)
 * Just to let you know, I altered your code a little and got rid of the errors :`
   public function widget($args,$instance){
    extract($args); extract($instance);
   $title = apply_filters(‘widget_title’,$title); echo ‘<div style=”padding-left:
   40px”>’.$before_title . $title . $after_title; echo ‘<ul class=”links_with_icons”
   >’; for($i=0;$i<$numB;$i++) { $count=$i+1; $target = ‘iT’.$count; $link = ‘iLink’.
   $count; $name = ‘iName’.$count; $icon = ‘iIcon’.$count; $nofollow = ‘iFollow’.
   $count;
 *  if(empty($$name)) return false;
 *  //Determining Whether To Open In New Window Or Not
    if($$target == 1) { $tar
   = ‘target=”_blank” ‘; } else { $tar = ”; }
 *  //Determining If Link IS No Follow
    if($$nofollow == 1) { $fol = ‘rel=”nofollow”‘;}
   else { $fol = ”; }
 *  //Parse URL for proper output in HTTP or HTTPS environment
    $imgurl = parse_url(
   $$icon); $imgsrc=$imgurl[“host”].$imgurl[“path”];
 *  echo ‘<li class=”link_with_icon”><img src=”//’.$imgsrc.'” alt=””><a ‘.$fol.$
   tar.’href=”‘.esc_attr($$link).'”>’.esc_attr($$name).'</a></li>’;
    } echo ‘</ul
   ></div>’;
 *  }`
 * Something to do with $beforewidget and $afterwidget was causing the problem

Viewing 1 replies (of 1 total)

The topic ‘W3C validator problems’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/links-with-icons-widget.svg)
 * [Links With Icons Widget](https://wordpress.org/plugins/links-with-icons-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/links-with-icons-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/links-with-icons-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/links-with-icons-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/links-with-icons-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/links-with-icons-widget/reviews/)

## Tags

 * [w3c validator](https://wordpress.org/support/topic-tag/w3c-validator/)

 * 1 reply
 * 1 participant
 * Last reply from: [Contortion](https://wordpress.org/support/users/contortion/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/w3c-validator-problems/#post-5598969)
 * Status: not resolved