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.
Post Revisions:
- 16 August, 2010 @ 10:39 [Current Revision] by michael castilla
- 5 August, 2010 @ 4:51 by Ryan Imel
- 12 February, 2008 @ 20:11 by Ryan Imel
Posted February 12, 2008
Thássius V. said:
Talking about the second tip, if your WordPress is installed in the root folder, you just need to put “/whateveryouwant”.
For example:
Homepageon February 13, 2008 at 12:11 am
shane said:
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?
on February 13, 2008 at 10:29 am
Alain said:
For the second tip… you can just do:
<?php bloginfo(‘url’); ?>
on February 13, 2008 at 5:51 pm
Lordo said:
Nice post. Thank you for sharing that.
on February 21, 2008 at 2:36 pm