I want to display the thumbnail of a post. If the user clicks the thumbnail he gets directed to that post. But when clicking it I get a 403 ERROR. I'm new to php what is wrong?
PHP
<?php
query_posts('cat=5');
while (have_posts()) : the_post();
the_title();
echo '<a href="<?php the_permalink();?>">';
the_post_thumbnail();
echo '</a>';
endwhile;
?>
<?php the_permalink();?>
Displays the URL for the permalink to the post currently being processed in The Loop. This tag must be within The Loop, and is generally used to display the permalink for each post, when the posts are being displayed. Since this template tag is limited to displaying the permalink for the post that is being processed, you cannot use it to display the permalink to an arbitrary post on your weblog. Refer to get_permalink() if you want to get the permalink for a post, given its unique post id.
<?php echo get_permalink(1); ?>
http://codex.wordpress.org/Function_Reference/the_permalink
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With