I'm creating a wordpress theme. Every time I add <!--more--> in the back-end posts section of wordpress it creates something that says "Continue reading ".
However there is always a <p></a></p> right below it. I can't find what the problem is.
Html
<p>Continue reading »</p> <p></a></p> <p> Posted in <a href=\"http://localhost/wp-jamy/?cat=1\" title=\"View all posts in Uncategorized\" rel=\"category\">Uncategorized</a> | <a class=\"post-edit-link\" href=\"http://localhost/wp-jamy/wp-admin/post.php?action=edit&post=16\" title=\"Edit post\">Edit</a> | <a href=\"http://localhost/wp-jamy/?p=16#respond\" title=\"Comment on Lorem Ipsum Dolor Sit Amet\">Comment;</a></p>
I found a solution (for anyone interested). As soon as I took the <p></p> away it stopped having the problem. However I wanted "continue reading" on a separate line. So after adding spans and <div class="clear"></div>, etc. (It would still have an extra <p> at the beginning of the text, but it wouldn't close it, eve if I did in the php)
its normal. <p></a><p> is an error to HTML validation because of the </a>. you're basically asking any HTML processor to process an ending part of a hyperlink to an unknown location inside a paragraph of nothing. There are two easy ways to fix this. either remove </a> or change it to '<a href="url">label</a>' but replace url with an actual url to a webpage and label will be the text that will appear as a hyperlink.
Every time I add <!--more--> in the back-end posts section of wordpress it creates something that says "Continue reading ".
However there is always a <p></a></p> right below it. I can't find what the problem is.
Html
Php
<?php the_content('<p>Continue reading »</p>'); ?><p><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('Comment;', '1 Comment »', '% Comments »'); ?></p>
Any help would be appreciated.
As soon as I took the <p></p> away it stopped having the problem. However I wanted "continue reading" on a separate line. So after adding spans and <div class="clear"></div>, etc. (It would still have an extra <p> at the beginning of the text, but it wouldn't close it, eve if I did in the php)
I changed it to:
<?php the_content('<br /><br />Continue reading »'); ?>which validates nicely.
Weird problem don't you think?
There are two easy ways to fix this. either remove </a> or change it to '<a href="url">label</a>' but replace url with an actual url to a webpage and label will be the text that will appear as a hyperlink.
We can see the first < p > tag don't have the end tag.
If your theme have the loop.php file take a look on this code:
and changes it to:
and it will output this: