php - Error getting the URL of a specific post


I have a problem with a PHP line:

echo "<a href='".the_permalink(get_the_id())."'>".get_the_post_thumbnail(get_the_id(), array(150,120))."</a>";

What I'm trying to achieve is to show an image pointing to its post where it came from.




Since you're concatenating the string, try get_permalink instead of the_permalink.

People are also looking for solutions to the problem: PHP Version 5.4.13 Bug? CodeIgniter Bug? Or, Explanation?


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.