Hi I hope you can help me with some advice.
I set up a website with a blog. The excerpts are shown on category.php
If there is content the excerpt is followed by a ‘read more’ link to the post. If there is nothing in content. It does not show ‘read more’
To show this link I’ve written the following piece of code.
<?php
global $post;
if ( empty( $post->post_content ) ) {
echo '';
} else {
echo '<p class="laes-mere"><a href="<?php the_permalink(); ?>">Læs mere...</a> </p>';
}
?>
The ‘read more’ (Læs mere…) shows up if there is content. This works exactly as I want it to. The problem is that the permalink does not work. I get this error
Not Found
The requested URL /< was not found on this server.
This is the page http://rubowarkitekter.dk/?cat=21
Any advice would be great. Thank you.
Ellen
You have opened the php tags when php tags are already opened try this
You can also get the post link by using get_permalink