10 WordPress Tips to Take You to the Next Level
Join LonePlacebo.com on Facebook!

Are you getting the most out of your WordPress blog or website? Obviously not since you are reading this post, which by the way you shouldn’t forget to share with your friends, family, and neighbor’s cat. The beauty of WordPress lies in its massive scope of possibilities to experiment and create amazing things you’ve never dreamed of. In this post, I will share with you ten incredible tips I’ve come across and really found useful. I hope you discover something new.
-
How to add an author section in your posts
-
How to Delay RSS Feed Publication
-
How to Add Hotlink Protection to your site
-
Read More link jumps to top of post page
-
Prevent WordPress from replacing code snippets with “normal” quotes
-
Display Total Number of SQL Queries on Your Blog
-
Split posts into separate pages
-
Display Google Adsense Between Blog Posts
- Go to your index.php file
- Locate this code snippet:
- Add this code before it:
- Next, locate this code snippet:
- Add this before it:
-
Change the Size of the Post Box
-
Display RSS FeedBurner Subscriber or Twitter Follower Count in Plain Text
You’ve just written a fabulously eloquent post called “5 Reasons Why Twitter is Better than Beer Pong.” Things are looking great on Google Analytics, and people are submitting the article to Digg and Stumbleupon in massive numbers. Problem is, no one knows who wrote this Shakespearean masterpiece. Here’s how you can add a simple author section in the bottom of your posts.
First off, make sure your author bio is completely filled out in your profile page(name, website url, biographical info). Then, proceed to your single.php file. Add the following chunk of code:
<div id="author-info">
<div id="author-image">
<a href="<?php the_author_meta('user_url'); ?>"><?php echo get_avatar( get_the_author_meta('user_email'), '80', '' ); ?></a>
</div>
<div id="author-bio">
<h4>Written by <?php the_author_link(); ?></h4>
<p><?php the_author_meta('description'); ?></p>
</div>
</div>
Here, three div’s mark out the structure of your author section. The author-info id boxes the entire content, the author-image id is where your handsome face will sit, and the author-bio id is where your author bio will show. I’ve also included some handy WordPress template tags as well.
Now that you have the HTML/PHP set up in your single.php file, it’s time to style the author section in your style.css file. Here’s the CSS I used to style my author section:
#content div#author-info {
background: #eaeaec; padding: 10px; margin: 0 0 15px 0;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
overflow: auto;
box-shadow: 1px 1px 12px #2D1D1D;
-moz-box-shadow: 1px 1px 12px #2D1D1D;
-webkit-box-shadow: 1px 1px 12px #2D1D1D;
}
#content div#author-info div#author-image {
float: left; margin: 0 10px 5px 0; border: 5px solid #DCDCE1;
}
Here, I used some wicked-cool CSS3 box shadow effects that probably won’t impress you. Feel free to use it on your blog.
Source: Line 25
Oftentimes, you finish a post and hit publish. The next day, you find out that something is terribly wrong. For instance, you mistakenly quoted the Pope as being the person who you played golf with last week rather than your friend Poppy. Sure, you can quickly edit the mistake but that will not do you any good for your RSS feed readers. With your credibility forever tarnished, all hope is lost. Right?
Luckily, WPEngineer has a solution for you. Simply add this code to your functions.php file:
/**
* puplish the content in the feed later
* $where ist default-var in WordPress (wp-includes/query.php)
* This function an a SQL-syntax
*/
function publish_later_on_feed($where) {
global $wpdb;
if ( is_feed() ) {
// timestamp in WP-format
$now = gmdate('Y-m-d H:i:s');
// value for wait; + device
$wait = '5'; // integer
// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
$device = 'MINUTE'; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR
// add SQL-sytax to default $where
$where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
}
return $where;
}
add_filter('posts_where', 'publish_later_on_feed');
This code will delay the publishing of your latest post to RSS feeds by 5 minutes. Of course, you can adjust that span of time by changing line 14 above.
Content thieves exist on the Internet. (NO WAY!) Don’t believe me? Then you should check your site for copycat offenders at Copyscape.com . Whereas there is no sure way to directly remove this plagiarized content, you can at least deter some thieves by using this hotlink protection method in your .htaccess file located in your root directory:
Make a backup of your .htaccess file before proceeding! Trust me! Don’t cry to me about it in the comments section below if you forget.
#Begin Hotlink Protection
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yoursite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteCond %{HTTP_REFERER} !msn\. [NC]
RewriteCond %{HTTP_REFERER} !yahoo\. [NC]
RewriteCond %{HTTP_REFERER} !^http://www.feedburner.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://feeds.feedburner.com/yoursite$ [NC]
RewriteRule .*\.(jpe?g|gif|bmp|png|jpg)$ /images/nohotlink.jpe [L]
#End Hotlink Protection
I highlighted the three lines you need to change above. So far, this method has worked brilliantly for me, and also not so brilliantly. Before, I did not include the feedburner code, and thus all of my images in my RSS Feed began displaying my hotlink image, which by the way looks like this:

Intimidating? I thought so. Please use this with caution though, especially since you are dealing with the .htaccess file.
I no longer enable hotlink protection on this site due to its inconsistency and tendency to replace images on this site with the hotlink image. If you have a better method, please feel free to share them in the comments section below.
Source: David Airey
By default, the <!--more--> tag will send readers to the location of the tag on the post. Alternatively, you can have the more link send readers to the top of the post page instead. Simply, add this code to your functions.php file:
function remove_more_jump_link($link) {
$offset = strpos($link, '#more-');
if ($offset) {
$end = strpos($link, '"',$offset);
}
if ($end) {
$link = substr_replace($link, '', $offset, $end-$offset);
}
return $link;
}
add_filter('the_content_more_link', 'remove_more_jump_link');
Source: WordPress Codex
Imagine my angst when I sat in front of my pathetic Gateway laptop wondering why the code I used from a site doesn’t seem to work when I paste it into my files? I obviously made no errors since I’m a coding god, so it must be the Internet’s fault right?
By default, WordPress replaces quotes in code snippets you copy and paste from somewhere and converts them to “curly” quotes instead of the “normal” quotes. To solve this, paste the following line of code into your functions.php file:
<?php remove_filter('the_content', 'wptexturize'); ?>
Source: WPRecipes
Queries are evil. They slow down your site as you begin to accumulate more, which can negatively effect the user experience. In fact, Google agrees too. The first step to lowering queries is to know how many you actually have. Simply paste the following line of code somewhere on your site. I prefer going after the footer.php file.
<?php if (is_user_logged_in()) { ?>
<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.
<?php } ?>
If you want this to be publicly shown, simply remove lines 1 and 3.
This tip is quite handy when you are dealing with lengthy posts, especially those that contain a lot of pictures. To reduce the possibility of people jumping ship as they wait for your “1,000,000,000,000 Pictures of Funny Cats” epic post to load, add this tag to any section of your article you want to split into a separate page:
<!--nextpage-->
Some themes may not support this. You can check by locating this code snippet in your single.php file:
<?php wp_link_pages(); ?>
Source: WordPress Codex
According to some people who like to call themselves “SEO’s”, placing Google Adsense ads or any ads in general between your first and second post has been found to increase your CTR. Here’s how to do it.
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php $count = 1; ?>
<?php endwhile; ?>
<?php if ($count == 1) : ?> – Insert your Google AdSense code here – <?php endif; $count++; ?>
Just make sure you insert your Google ad code in line 2 as shown above.
By default, the WordPress post box(where you write new posts) is set to 10 lines. To adjust this value to your liking, go to Settings>Writing. On the first line that says “Size of the post box,” simply replace the default value to your preferred box size. If you’re one of those people who rarely looks at the Settings categories, this may be very useful.
Tired of displaying your abysmal RSS Feed reader and Twitter follower count with these guys?
LonePlacebo.com's actual RSS Feed and Twitter follower count.
By displaying these chicklets as plain text instead, this opens up new avenues for you to customize the look like never before. The technique I’m about to show you requires you to create two files you will need to upload to your theme’s folder.
Display RSS Feed Reader Count
The first file you will need to create is for the RSS Feed reader count. Name it feed.php and paste the following inside it:
<?php //get cool feedburner count $whaturl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=Feed Here"; //Initialize the Curl session $ch = curl_init(); //Set curl to return the data instead of printing it to the browser. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set the URL curl_setopt($ch, CURLOPT_URL, $whaturl); //Execute the fetch $data = curl_exec($ch); //Close the connection curl_close($ch); $xml = new SimpleXMLElement($data); $fb = $xml->feed->entry['circulation']; //end get cool feedburner count echo $fb; ?>
Remember to edit line 3 above where it says Feed Here and replace it with your the name of your feed. In other words, the name that comes after the “http://feeds.feedburner.com/” in your feed address is your feed name. Also, you must enable the Awareness API in Feedburner, which can be found under the Publicize tab. By default, it is disabled. The feed.php file should be placed inside your active theme’s folder.
To display the feed count on your site, insert the following code in any of your theme’s files such as your sidebar.php(if you have one):
<?php include("feed.php"); ?>
Display Twitter Count
Same idea will apply for showing your Twitter count. Name the second file twitter.php and insert the following code inside:
<?php
$tw = get_option("twitterfollowerscount");
if ($tw['lastcheck'] < ( mktime() - 3600 ) )
{
$xml=file_get_contents('http://twitter.com/users/show.xml?screen_name=Feed here');
if (preg_match('/followers_count>(.*)</',$xml,$match)!=0) {
$tw['count'] = $match[1];
}
$tw['lastcheck'] = mktime();
update_option("twitterfollowerscount",$tw);
}
echo $tw['count'];
?>
Don’t forget to edit line 5 with your Twitter username. Place the file in your active theme’s folder. Include the following code to display the Twitter count:
<?php include("twitter.php"); ?>
Source: Blogussion
I hope you found something useful to use on your own WordPress blog or site. Share some of your favorite WordPress tips or hacks in the comments section below!
Related posts:
- 5 Solutions to Common WordPress Problems
- Yet Another SEO Plugins for WordPress List
- 4 Ways to Maximize Your WordPress.com Blog
- How to Customize your WordPress Admin Area
- How to Install MAMP on OS X for Local WordPress Theme Development

Hi Tony, thanks for sharing these tips. #9 is my personal favorite. It’s simple and it’s good to remember when you are doing a guest post on another WordPress blog.
I’ll share this with some other WordPress users.
@Ileane
Ileane@Blogging´s last blog ..SEO Site Tools Finds Google Page Rank
Sharing is caring, Ileane.
Great stuff, Tony. I know a couple of these tips, but there are several that are new to me. I’ll have to give your SQL queries tip a try.
One of my own favorite tips is highlighting author comments, by making them appear a different color from normal comments. I’d have to dig into my theme to remember how I did that, though.
Interesting thing you mention about the author highlighting. We both use the same theme, but I’ve been stumped trying to figure it out. I’ll make sure I tell you if I find out how to do it.
Whaddya know! I figured it out! Just enter this in the comments section of the style.css file:
#content li.bypostauthor {background-color: #B3FFCC!important; }Here are the articles that showed me how to do it: http://inspectelement.com/tutorials/7-very-simple-tips-and-tricks-for-getting-more-out-of-wordpress/
and http://www.mattcutts.com/blog/highlight-author-comments-wordpress/
The first one helped me figure out the selector and the second how to style the background color. It seems that !important is quite essential to showing the background color. I’ll try and figure it out later.
Nice collection of tips. Where were you a few months ago when I was looking for them
I have about a dozen authors on my site and have quite a bit of author-centric code.
Kosmo @ The Casual Observer´s last blog ..Review: Lady Antebellum – Need You Now
Great tips Tony! I like the hotlink protection tip for htaccess. very useful
Omer Greenwald´s last blog ..Does Your Blog Have Fixed or Fluid Layout?
I agree. It’s a really useful tip.
Great tips. Some of them are new to me.

Thorsten´s last blog ..30 extravagante Website Header Designs
Excellent post, a few ideas I never thought of.
FAQPAL´s last blog ..30 Things to do After Installing WordPress | Tech’n'share Dot Com
Hey, Tony!
No. 7 is terrific – I tend to be a bit wordy in real life and have (so far) avoided verbosity on my blog b/c I realized the page would run on and on. But no more…..
Monique´s last blog ..It’s all Greek to me
Brevityness is divinityness. Thanks for stopping by, Monique! You’re awesome-tastic.