6 Basic Yet Significant WordPress Hacks for Your Blogs You Can’t Miss!

You may often find some really captivating WordPress blogs enriched with features, and just start thinking of how to get those features in your WP powered blog as well. This is something that most of the bloggers apparently would have experienced.

6 Basic Yet Significant WordPress Hacks for Your Blogs You Can’t Miss!

The web sphere is filled with plenty of tricks and hacks that help to improve the features and functionality of WordPress site/blogs.

Wondering why?

Generic WordPress blog themes can’t be a lot boring and bland. And thus, you may need to customize them to make them work in sync with your requisites. For this purpose, it becomes essential to have knowledge of certain WordPress hacks. To help you out in this guest post I’ll be discussing about my favorite top 6 commonly used yet effective WP hacks that you’ll surely find useful.

1. How to Use a Custom WordPress Page as Your Homepage

This has become one of the most preferred hacks among people. If you don’t want to display your recent blog entries as main entries in the blog page, just customize it! Here you’ll first have to understand – as how to create a custom WP page that fits your homepage. Follow the below mentioned steps to create a new custom page that’ll serve as your homepage in the WordPress site.

  1. Login to your WP admin panel, and from the WP dashboard select the ‘Pages’ tab.
  2. Now, click on Add New (a new page will open up).
  3. Give the page a title say “Home”.
  4. Create your homepage content just like you do when adding content in a blog post.
  5. Click the Publish button.

Custom WordPress Page as Your Homepage

Once you’ve created a custom page, next construct another page using the same steps as mentioned above except you’ll not need to publish your content when creating second page. Now, you’ll have to set the newly built page as your homepage. For this purpose, follow the following steps:

  1. Click on Settings section on the left navigation.
  2. Click on the Readings from the ‘Settings’ section.
  3. Click on the Static Page option, and select one of your page (Front Page) as Home, and another page (Posts Page) as your blog page named as OvoControl Blog.
  4. Click on Save Changes button and you’re done.

Custom WordPress Page as Your Homepage

Following the above steps you’ll now have a custom page set as your Front page and a second page which is set as blog page, as shown in the image above.

2. How to Showcase Random Header Images in WordPress Site

You may have come across several blogs having large header images and that too static. Using the same header picture will make your blog design dull, which eventually lessens your user’s interests towards your posts. However, you can display random header images that rotates when a visitor visits your WordPress website. This hack helps to make the blog posts more interactive and lively. Plus you can select as many images as you would like to add in the header. First you’ll have to give name to the images you want to add in the header section in the following format: headerimg_1.gif, headerimg_2.gif, headerimg_3.gif, headerimg_4.gif, headerimg_5.gif.

Showcase Random Header Images in WordPress

Once you named all the images, you’ll need to paste the code as mentioned below in your WP header.php file – wherein you want to display the images.

<img src=http://path_to_images/headerimg_<?php echo(rand(1,5)); ?>.gif width="image_width" height="image_height" alt="image_alt_text" />
3. How To Add Author Bio To Your WordPress Posts

If you’re running a WP blog, then certainly you’ll be yearning for displaying your bio information within your website profile – at the bottom of your posts. Bear in mind that this may not be a feasible exercise for WP blogs having single users, but is definitely a worthwhile option for multi-authored blogs. Well, in many cases often when readers find a post enticing they seemingly show interest to know more about the author of that particular post. But most of them don’t wish to be redirected to another page when it comes to exploring more info about the author. Thus, in multi-authored blogs adding author bio info at the end of the respective blog posts let readers recognize the author of the post and obtain his/her information without having to refer to another page.

Now you don’t need any plugin to embed bio info of the author, as in WP admin panel there’s an option that allows users to add a bio to their profiles. In order to use this hack, you are required to copy-and-paste the code as shown below – wherever you need to show the bio in your single.php file.

<div id="author-bio">
<h3>About <?php the_author(); ?></h3>
<?php echo get_avatar( get_the_author_email(), '70' ); ?>
<?php the_author_description(); ?>                       
</div>

Want to style up your bio a little? You can do so by using the following css code:

#author-bio { border-top: 1px dotted #cccccc; padding: 15px 0; }
#author-bio h3 { font-size: 16px; margin: 0 0 5px 0; }
#author-bio img { float: left; padding: 2px; border: 1px solid #cccccc; margin: 5px 15px 0 0; }

In the above code you’ll observe that there is a certain code added in the style.css to get a gravatar. Make sure unless you don’t wish to have the default WordPress gravator shown, get your email registered that you used for your blog post with Gravatar. Lastly, upload some avatar you want to be shown in your bio. Besides, changing your default gravatar help you promote your blog in a more effective manner.

4. How to Set the Expiration Date of Your Blog Posts

This hack can prove to be quite useful in case you constantly organizes a contest or want to keep your blog posts updated. How? By setting up the expiration date of your posts you no longer need to manually remove the posts or any other piece of information shown in the blog, rather you can make it expire automatically. For instance, let’s suppose you just posted an offer on your blog, but don’t want the offer to be shown after a determined time period, you can automatically remove the offer using the following code. But you’ll have to substitute your WP loop with this code:

<?php
if (have_posts()) :
while (have_posts()) : the_post(); ?>
$expirationtime = get_post_custom_values('expiration');
if (is_array($expirationtime)) {
$expirestring = implode($expirationtime);
}

$secondsbetween = strtotime($expirestring)-time();
if ( $secondsbetween > 0 ) {
// For example...
the_title();
the_excerpt();
}

endwhile;
endif;
?>

After using the above mentioned code, make sure to use custom fields at the time of writing a blog post, so as to set an expiration date. For doing so, you’ll need to choose the key “expiration” and make use of the date format – mm/dd/yyyy 00:00:00

Note that using this hack you can’t remove the entire post or whatever information you wish to hide. You can’t even unpublish it, instead the hack will help you exclude the posts or other info from getting displayed until the loop terminates.

5. How to Highlight Author Comments in WordPress Blog

Highlight Author Comments in WordPress Blog

Did you just came across a blog wherein author’s comments appear to be more highlighted than the other comments? Then, by using this hack you can give a distinguishing look to the comments posted by the author. For doing so, you will need to access the style.css file in your template folder and then embed the following code:

.authorstyle { background-color: #B3FFCC !important; }

In the next step you are required to open comments.php file placed in your WordPress site’s themes folder. Find the code similar to the one given below:

<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>"></li>

Once you’ve found the code, replace it with the following code:

<li class="<?php if ($comment->user_id == 1) $oddcomment = "authorstyle"; echo $oddcomment; ?>"></li>

Make sure to change 1 to author’s user id. Doing this, will make your blog comments have a disparate background just for the author’s comment section.

6. How to Allow Multiple Authors Associated With a Single WordPress Post

Allow Multiple Authors Associated With a Single WordPress Post

Have you seen a WP blog that is run by multiple authors? It’s possible that you may also want to embed the similar functionality in your blog. WordPress show only a single author by default, so in order to give credits to multiple author of your WP posts and pages, you can use the Co-Authors Plus plugin. This plugin helps to assign multiple bylines to your articles with help of a “search-as-you-type” option box.

Below are few steps you need to follow to understand how to install and configure the Co-Authors plugin:

  1. Download and install the plugin. After installation click on Activate button.
  2. Go to Users panel in WP dashboard, click on Guest Authors option.
  3. Click on Add New and fill all the details.

If you’re a blog owner and want to save yourself from creating new user accounts for people who will post guest content only once, using Co-Authors Plus plugin will enable you to add new guest authors (willing to post contribute content for your WordPress blogs) without the need to create their accounts.

Let’s Wrap Up!

Even though after choosing a premium WordPress blog theme you may want to customize it, to add enhanced functionality. So, if you want to improve your WordPress blog and bring in new changes to it, then by reading the aforementioned top 7 WordPress hacks you’ll definitely be able to make some significant improvements to your blogs. Hope you find this post to be useful!

Like it? Share it.

7 Comments

  1. 6 more reasons NOT to use WordPress if you ask me. The title says it all and if you have to hack it why not use a REAL CMS instead of a hackable blog tool? I know for a fact that Joomla can do everything in this hack article without doing anything but changing a few parameters.

    • Kevin,

      If you want to talk about a “REAL CMS,” how about not using either WordPress or Joomla! in the first place, and moving away from playing Lego in a PHP/MySQL environment to building something useful in python, rails, or node?

      For every “WordPress is not a REAL CMS” argument, the same can be said of Joomla! especially when compared with a bespoke CMS coded from scratch specifically for a client’s needs.

      • Really? I have been using Joomla for years and I have yet to have one issue with it and there is not a website I need I could not build with it. Although I would not touch an ecommerce site with it.

        Bespoke should only be used for extreme cases unless it is your intent to make excuses for ripping off your clients because you want to reinvent the wheel for them. Or you are trying to prove something to someone that could care less how good you think you are!

        The argument that you have to build it from scratch is about as real as calling WP what it is not. What a from scratch CMS is in reality is to stroke someones ego. It makes about as much sense as spending a hundred grand to build a car when there are companies that have spent millions designing and perfecting them. Thanks but no thanks, I would rather take advantage of a community of professionals dedicated to something bigger than themselves.

        I will pit Joomla up against anything anyone can do from scratch. I used to think like that and then I woke up! Now I am not glued to a computer because I think I can do something better than 40 developers and I don’t have to suck clients for every dime to cover my cost.

      • “I have been using Joomla for years and I have yet to have one issue”
        Because Joomla is terrible to try to updated compared to WordPress. You have to upload individual files and components (unless they recently changed that) rather than just clicking a button and having the software do everything.

  2. Victoria: I enjoyed your article and took away some good information but — and I would say this to anyone I know — you need to proofread your columns for spelling and grammar. There were many lines in your article that sounded like they were written by a teenager because of the grammar. I’m not trying to be a hater, though. I know from personal experience that people form opinions of someone’s expertise by the way they write and it would be a shame if this affected you and your obvious knowledge of the WP platform. Thanks!

Leave a Comment Yourself

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>