Results 1 to 2 of 2
Jun 23, 2013, 02:33 #1
- Join Date
- May 2006
- 0 Post(s)
- 0 Thread(s)
Element div not allowed as child of element ul in this context
getting the following validation error:
"Element div not allowed as child of element ul in this context. (Suppressing further errors from this subtree.) "
for this bit of code:
<div class="section_thumbnails group">
<!-- LOOP START -->
<?php $the_query = new WP_Query( 'showposts=3' ); ?>
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<!-- THIS DISPLAYS THE POST THUMBNAIL, The array allows the image to has a custom size but is always kept proportional -->
<div class="col span_1_of_3">
<li> <?php the_post_thumbnail( array(70,70) );?></li>
<!-- THIS DISPLAYS THE POST TITLE AS A LINK TO THE MAIN POST -->
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<!-- THIS DISPLAYS THE EXCERPT OF THE POST -->
<p><?php echo get_excerpt(); ?>
<!-- READ MORE LINK -->
<a href="<?php the_permalink() ?>">More...</a></p>
<!-- LOOP FINNISH -->
Anyone know a fix for this? I have tried a few things but can't get it to both display correctly and validate at the same time.
Jun 23, 2013, 04:14 #2
- Join Date
- Jun 2007
- 219 Post(s)
- 12 Thread(s)
AFAIK, the only permitted child of a <ul> element is a <li> element. <li> elements can have block elements (such as a <div> element) as a child, but <ul> elements cannot.
If you wish for some help tidying up your code, please post the HTML generated by the PHP, as outlined in this post: http://www.sitepoint.com/forums/show...=1#post5410283
You might also want to consult this thread.