Due to updates, over time, that have been made to the site and the age of this article, this post may not display correctly. In particular images may be missing or product reviews display incorrectly.

If this is the case and you'd particularly like me to fix it, then please reach out to me on Twitter.

If you have a need to add your site’s current PageRank to a page or post (for example, you may have a page for the media/PR on which you may wish to highlight it),  the following piece of code, added to your theme’s functions.php file, will achieve just that.

All you have to add in a post or page is add [pagerank] wherever you wish the PageRank to appear.

To achieve this, the code uses the site Prapi.net to retrieve the information. The result is cached for 24 hours so as not to inflict on site performance.

You can change the caching time by modifying the number 86400 (which represents the number of seconds to cache for). If you wish to change the name of the shortcode, then simply change that on the final line.