Approximate time to read: <1 minute
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.