Wordpress & IE specific markup error
I have this piece of code within a Wordpress loop that gathers all parent terms of the current post and displays children terms of each parent in an unordered list.
<?php $taxonomyName = "custom_tax"; $parent_terms = get_terms($taxonomyName, array('parent' => 0, 'orderby' => 'slug', 'hide_empty' => false)); ?> <ul> <?php foreach ($parent_terms as $pterm) : $terms = get_terms($taxonomyName, array('parent' => $pterm->term_id, 'orderby' => 'slug', 'hide_empty' => false)); foreach ($terms as $term) :?> <li><a><?php echo $term->name ?></a></li> <?php endforeach;?> <?php endforeach;?> </ul>
This works in FF, Chrome, Safari & Opera, however in IE9, I get
<ul> <a> <li>Term1</a></li> <a> <li>Term2</a></li> ... <ul>
I'm sure there is a simple fix, I checked and didn't find any similar issues here or in the WP forum so I'm hoping someone can shed some light on whether this is a known issue.
Thanks in advance.
The HTML code generated by you PHP script isn't affected by the browser you are using. Using output buffering you should save the generated html into a file, to see what html code you script is generating.
Clear the cache in IE and try it again. Does this help?