remove automatic formatting on Excerpt box
-
Sorry if this is a newbee question – have searched internet and forums to no avail.
For my homepage I want images instead of text summaries leading into a post. Seems easy enough – I put the code below into my page template and in the excerpt box I insert the code for the image which will be clicked to go to the post…
<p class="post"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_excerpt(); ?></a></p>
My problem is this:
Th excerpt box automatically generates a <p> tag around the image code I insert. This is causing the page to fail validation as the output code results in
<p class="post"><a href="https://www.linkaddress.co.uk/post1/" rel="bookmark"><strong><p></strong><img src="https://www.linkaddress.co.uk/wp-content/uploads/2010/01/testpost.jpg" alt="testpost" /><strong></p></strong> </a></p>
… that extra p tag surrounding the image is not valid markup.
I’ve tried adding a wysiwyg editor to the excerpt box (TinyMCE+advanced) to edit source code and remove the P tags – but upon saving they are automatically added again.
Is there a way I can stop the excerpt box automatically enclosing the contents in a P tag?
Any help much appreciated.
- The topic ‘remove automatic formatting on Excerpt box’ is closed to new replies.