WordPress QuickTips
Here’s a little snippet of code that could come in handy: a total post count for a blog. Put this in your page to display the total amount of posts you’ve made:
<php the_author_posts(); ?>
This might come in handy when you’d like to display the total number of tutorials on a tutorial blog, sites indexed in a site gallery, etc.
Here’s another WordPress QuickTip that will save you some extra keystrokes. Whenever you want to link to an image, place in your site, etc, this little PHP snippet will save you the hassle of typing in the web address:
<?php echo(get_option('siteurl')); ?>
This will display the complete URL (http://www.yoursite.com) wherever you put this tag.






Thássius V.
Posted on February 13th, 2008 at 12:11 am
Talking about the second tip, if your WordPress is installed in the root folder, you just need to put “/whateveryouwant”.
For example:
Homepageshane
Posted on February 13th, 2008 at 10:29 am
I am not sure you want to “save keystrokes” with that little trick for images, correct me if I am wrong, but what that call the database every time it runs, slowing down your site?
Alain
Posted on February 13th, 2008 at 5:51 pm
For the second tip… you can just do:
<?php bloginfo(’url’); ?>
Lordo
Posted on February 21st, 2008 at 2:36 pm
Nice post. Thank you for sharing that.