W3C-Validation

Reports about issues that you encounter in Suffusion. This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.
Forum rules
This forum is being officially closed with effect from 3rd February 2019. Future support requests can be posted on the GitHub page at https://github.com/sayontan/suffusion/issues.
Locked
lookaround
Posts: 3
Joined: 21 Jan 2010, 04:16

W3C-Validation

Post by lookaround » 21 Jan 2010, 04:29

Hi Sayontan,

I am testing your suffusion-theme in the "apache sandbox" at the moment. Excellent work so far! 8-)

But, in relation to the w3c-validation, I have also found a huge problem in relation to the "featured-post.php"-file:

$ret .= "<div class=\"$excerpt_position\">";
$ret .= "<p>";
$ret .= "<a href=\"".get_permalink($post->ID)."\">";
if ($suf_featured_excerpt_type != 'excerpt') {
$ret .= get_the_title($post->ID);
}
$ret .= "</a>";
if ($suf_featured_excerpt_type != 'title') {
$excerpt = get_the_excerpt();
$ret .= apply_filters('the_excerpt', $excerpt);
}
$ret .= "</p>";
$ret .= "</div>";

The "<p>"-element is not allowed in a "div"-construct in this context. So you will get many error messages, if you use this construct (one error message per featured post!). :cry:
If one comments out the "<p>"-elements, the error messages are away and all is valid. :) Indeed, then there is a problem with the adjustment of the headline. :shock: I further try to find a suitable solution at the moment. Maybe it is also a "jquery"-point?

Do you have any ideas for this problem?

lookaround
Posts: 3
Joined: 21 Jan 2010, 04:16

Re: W3C-Validation

Post by lookaround » 21 Jan 2010, 07:17

Okay. My first result: I have moved the code a little and now the whole side is validated. :) Also the headline is at its right place. In addition, I have inserted an "ins"-element to show the readers that a clickable link is hidden. ;) Tested in Firefox, IE, Opera and Safari and it works very well …

The new code-part:

$ret .= "<div class=\"$excerpt_position\">";
$ret .= "<p>";
$ret .= "<ins>";
$ret .= "<a href=\"".get_permalink($post->ID)."\">";
if ($suf_featured_excerpt_type != 'excerpt') {
$ret .= get_the_title($post->ID);
}
$ret .= "</a>";
$ret .= "</ins>";
$ret .= "</p>";
if ($suf_featured_excerpt_type != 'title') {
$excerpt = get_the_excerpt();
$ret .= apply_filters('the_excerpt', $excerpt);
}
$ret .= "</div>";

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: W3C-Validation

Post by sayontan » 21 Jan 2010, 10:37

Thanks for the pointers. I always thought the problem was due to WP inserting <p> tags by itself, which is not in my control. I will give your suggestions a shot. One thing I couldn't understand was that in your code too you have <p> within <div>, so how does that validate? Moreover, I guess you already know, <p> tags within <div> are legitimate, but the reverse is not true.

lookaround
Posts: 3
Joined: 21 Jan 2010, 04:16

Re: W3C-Validation

Post by lookaround » 21 Jan 2010, 11:27

At the beginning of my "sandbox-trials" I also thought, it would be an internal WordPress point. But after I had removed all texts, the problem still existed. So I have done handicraft in the code. ;)

The "<p>"-element is permitted inside of "<div>"-parts, but it´s a question of the real position of the opening "<p>" and the closing "</p>". I think that´s a problem of xhtml-coding in php. So I have shifted the code a bit. After I had all texts in WordPress again, it all works in a really good way. So, the problem is the position of the "<p>" inside the “div”-component. A pure context thing. Sometimes, w3c is a little bit strange, isn´t it?! :roll:

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: W3C-Validation

Post by sayontan » 22 Jan 2010, 10:08

Thanks, I have included the fix in version 3.2.1 and submitted it for approval.

Locked