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


4 flawless WordPress Plugins for Employee Management

Keeping your employee management in check is an important part of ...


Kubernetes: Why Today’s Programmers Need to Understand

Launched by three Google engineers, Kubernetes is a container ...


Do I Need Endpoint detection and response tools ?

Endpoint detection and response (EDR) tools are designed to add an ...


How to Build a Killer Marketing Strategy for your WordPress Blog?

Running a blog over WordPress is seemingly an easy thing to do. The ...


5 Signs You Need a New Hosting Company

Web hosting has become cheaper and easier to attain than ever before. ...


5 Things to Consider When Designing A Logo For Your Startup

Designing a Logo is essential because it communicates your business. ...


What Is Access Control?

Access Control, When running a business, there are dozens of things ...


Process Management Solution For a Business

In order to be successful, a company needs to be on the same page and ...


5 Metrics You Should Track on Every Blog Post

As a blogger, you may have developed your blog with a variety of blog ...