Join Stack Overflow to learn, share knowledge, and build your career. Connect and share knowledge within a single location that is structured and easy to search. I want to display the thumbnail of a post. If the user clicks the thumbnail he gets directed to that post.
Do you want to change the URL of the categories and tags of your WordPress site or blog, without impacting your search engine optimization? Good idea! Because, by doing so, you can improve your positioning in search results, as well as the user experience, by making your web pages more intuitive to visit. We will see in this tutorial how to proceed step by step to get there, always following good SEO practices to keep your achievements. A little precision before you start. When it comes to changing URLs, you need to take the following two things into account in your configuration:. These two parts will form your final URL address: they are therefore to be differentiated and taken into account. Make a backup of your site and your database before any modification. Your best WordPress projects need the best host! The base for categories and tags on WordPress is the part of the URL that is present right with the category name.
2. In URL of the Post Without Custom Permalink Structure
Note that when used outside The Loop on a posts page index, archive, etc. Expand full source code Collapse full source code View on Trac. Pass in a post object instead of an ID This shows how you can you can get the permalink with the page title instead of the ID. Default Usage The permalink for current post used within The Loop. As the tag does not display the permalink, the example uses the PHP echo command. Link to Specific Post Returns the permalinks of two specific posts post IDs 1 and 10 as hypertext links within an informational list. Expand full source code Collapse full source code.
As you write more and more blog posts, the challenge is to make use of your extensive content and convert readers who might be viewing your older posts, to continue staying on the site and check out your latest content. However, sometimes all you want is a simple link to the latest blog post on your website towards the end of the article. No need for plugins or additional files — just a snippet of code added to functions. Open up your functions. It simply creates a function that returns the HTML output containing the link to the latest post, with the title. In this, we use the first function to get the HTML of the link to the latest post, and then simply append it to the existing content. In the screenshot below, you can see how it looks at the end of a random post. We can modify this function in many ways. For example, it looks a bit clumsy to have the latest post link to itself!