Wrapping a post in a tag instead of div – causes strange behaviour
-
This is so odd. I have my post wrapped in an _a_ tag instead of a _div_ so the entire post becomes a link ( instead of just the title ). For some reason if my post has a link in it – the get_content function somehow butchers the closing tags for all of the _a_ tags and breaks everything completely.
Here is the loop: (please don’t flame me for the inline styling – it’s only temporary)
<?php while (have_posts()) : the_post(); ?> <a href="#" style="display:block;"> <?php the_content() ?> <h3 id="post-<?php the_ID(); ?>"><?php the_title(); ?></h3> </a> <?php endwhile; ?>
The resulting render has the _a_ tag wrapping the entire post – just like it should. But for some reason it also renders that same _a_ tag AGAIN inside the post. !?
The post that it is trying to render has markup in it (divs,_a_ links). Does that break the_content function, should I use something else render the post!?
- The topic ‘Wrapping a post in a tag instead of div – causes strange behaviour’ is closed to new replies.