5 Advance WordPress Handy Tips

Ever wanted to be a expert in WordPress or have tried to resolve you basic blog issue? Here’s some nice tips that can really lead to learn cool things about wordpress. You must have some basic editing capability in wordpress and basic know how to PHP to perform below tweaks and home them!

Let us know in a short comment about which one is your favorite !! Want more of cool stuff?? Follow us @facebook @twitter.

1. Show Specific content on Front Page Only

If you want to show some image file, some DIV or any link just on the front page of your blog either in header, footer or in sidebar; Here’s a tweak to do that. Use below PHP tweak

 if ( is_home() ) {
 // This is a homepage
 } else {
 // This is not a homepage

Want to know more about tweak, Go to WordPress support for complete usage guide.

2. Get Custom Field Value

This is very useful thing while you are dealing with thumbnails. You can use WordPress custom fields to get value transfered to your code from post. Many functions are used for same purpose, Best of them are illustrated below:
Function 1

$thumbnail = get_post_meta($post->ID, 'thumb', $single = true);

Now use the variable $thumbnail at any place to echo the value of custom field thumb, you can change the value of preview to your desired one!
Function 2

$image = get_post_custom_values('img');

Same like the above function but this function will return the value in $image array, so you will have to use something like below to get the custom field value:

echo $image[0];

3. Adding some content between posts

Talking about home page, what if you want to place some text, image or some news after 2nd, 3rd or any number of post? Here we have a tweak!! You can use conditional statement(if else) with-in the PHP while loop. Let me show that for you!

Below is the normal PHP loop that you can find in your templates index.php file or default.php

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_content('Read the rest of this entry &amp;raquo;'); ?>
<?php endwhile; ?>
<?php else : ?>
 <b>Not Found</b>
<?php _e("Sorry, but you are looking for something that isn't here."); ?>
<?php endif; ?>

This is normal index.php page to show the posts. So how to trick for adding content between posts? This code should look like below:

<?php if (have_posts()) :
$i = 1; // We will created variable with 1 as initial value
while (have_posts()) : the_post();
if($i == 5){// check if the value of $i is 1
//Show Content before the fifth article
}; ?>
<?php the_content('Read the rest of this entry &amp;raquo;'); ?>
<?php endwhile;
$i++; //This is to add 1 in current value of $i
 else : ?>
<b>Not Found</b>
<?php _e("Sorry, but you are looking for something that isn't here."); ?>
<?php endif; ?>

So this was it and is simplest enough to understand. If you’re new to conditional statements, Learn them Here.

5. Add Breadcrumbs To Your WordPress Blog

Well its not fair to just write every code for you everytime, you can get help with plugins too. First lemme ask do you know Breadcrumbs?? for those who don’t, its a simple way to let your visitors know where they are now on your website. Breadcrumb trails are a good supplementary navigation system that aid in site usability. This plugin allows you to add breadcrumbs to your theme.

After installing the plugin just call the function like mentioned below:

<div class="breadcrumbs">

5. Get FeedBurner Subscriber Count

Purely inspired from Hongkiat, the simpler way to show the subcscriber count is to page the below function to anywhere in you template, probabily in functions.php or funtion.php. Remember to replace the Feedburner-id with yours one!

//get cool feedburner count
//Initialize the Curl session
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $whaturl);
$data = curl_exec($ch);
$xml = new SimpleXMLElement($data);
$fb = $xml->feed->entry['circulation'];
//end get cool feedburner count

And its done!! use below function to display the count at your desired place now.

echo $fb;


Cheers!! Folks


About Author
Nasir is passionate about Web technologies, Design Art and Video games and he really think code *is* art. It’s a well known fact that following me him brought people great fortune and a lot of cuddles! Check out his blog ThemesBank or Follow him @facebook @twitter

Recently Published


Web Development Vs. Software Development: What Is the Difference?

As technology continues to transform all aspects of our lives, a lot ...


Web Redesign : Is Your Landing Page Begging for one?

How do you know when it’s time to web redesign your landing page? ...


Customer Acquisition: Few Steps To Improve This.

Customer acquisition is essential to any business’s success — to ...


Mobile App Development Tools: 5 Enterprise-Ready For Rapid Deployment

There are several enterprise-ready mobile app development tools for ...


Docker: How To Build Better Development Security With It

The top concern among developers and DevOps teams is security within ...


Mobile Development: How to Reduce Costs

Modern markets have become so competitive that it has become vital ...


Know-How DevOps Benefits Your Business

The organizations in this current fast-paced environment need to ...


10 Best Prototyping Tools for UI/UX Designers

Website design for a client gets only successful if you follow their ...


Social Media Marketing: Strategy To Boost Ecommerce-Traffic

According to a recent study, the experts revealed that people aged ...