PSD to HTML PSD to HTML

22 Mixed Quality Wordpress Hacks

InstantShift - 22 Mixed Quality Wordpress Hacks

WordPress needs no introduction among designers and writers. It’s usually known as a synonym for blogging. Now days every other WordPress blogs look more or less similar, to stand uniquely out from the rest, you need to tweak it a little bit by using quality hacks.

You all must’ve known that the new version v2.8 is already arrived and most of you going to update your WordPress to v2.8 anyway. So, it’s a right time to implement some new hacks also.

Of Course, WordPress Codex is always the best place to learn about WordPress and its tweaks. But unfortunately, it’s too much for a simple WordPress user. This the only reason we compiled this fairly comprehensive list of the Quality WordPress Hacks to unleash the power of your favorite blogging engine.


One of the greatest things about blogging is the immediate feedback a blogger can get from his or her readers. Still it’s often possible that your readers don’t give you a wink about their likes and dislikes. Unfortunately, there is no way for you to find out about visitors thinking towards your blog or its design. It’s always essential to play safe and give others what they like. Out of many solutions the inspirational one is only promising and optimistic way to achieve desired changes. This article focuses on organized collection of some of the Most Wanted WordPress Hacks which will definitely make your blogging life easier.

You may be interested in the following tips and tricks related articles as well.

Please feel free to join us and you are always welcome to share your thoughts even if you have more reference links related to other tips and tricks that our readers may like.

Don’t forget to Subscribe to our RSS-feed subscribe to our RSS-feed and Follow us on Twitter follow us on Twitter — for recent updates.

Post Related Hacks

 

01. How to List Your Upcoming Posts

instantShift - Quality Wordpress Hacks

If you want to display your schedule posts in a list which can often help readers to give them heads up about what you’re going to publish in upcoming days. This can also help you to get new visitors and some more RSS subscribers. It’s not very hard to implement this functionality as it seems. You just need to simply paste this code where you’d like your future posts to be displayed.


<div id="zukunft">
  <div id="zukunft_header">

Future events
  </div>

 <?php query_posts('showposts=10&post_status=future'); ?>
  <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  <div>
  <p class=""><b><?php the_title(); ?></b><?php edit_post_link('e',' (',')'); ?>

 <span class="datetime"><?php the_time('j. F Y'); ?></span>
  </p></div>

 <?php endwhile; else: ?>

No future events scheduled.

<?php endif; ?>
</div>

Source Link

 

02. How to List Your Most Popular Posts

instantShift - Quality Wordpress Hacks

There are many ways by which you can show popular posts to your readers. It’s been quite a simple to install a plugin to display your most popular posts. But if you want to avoid plugins and want to create a list for your most popular post then you just need to paste the following code anywhere in your theme files. If you want to show popular posts in your sidebar section then simply go to sidebar.php and paste the code.

NOTE: Just change the “5″ in line 3 to change the number of displayed popular posts.


<h2>Popular Posts</h2>
  <ul>
  <?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 5");
  foreach ($result as $post) {
    setup_postdata($post);
    $postid = $post->ID;
    $title = $post->post_title;
    $commentcount = $post->comment_count;
    if ($commentcount != 0) { ?>

<li><a href="<?php echo get_permalink($postid); ?>" title="<?php echo $title ?>">
    <?php echo $title ?></a> {<?php echo $commentcount ?>}</li>
    <?php } } ?>

</ul>

Source Link

 

03. How to Display Related Posts

instantShift - Quality Wordpress Hacks

Related posts are often helpful to make your readers stay much longer on your website as they offer them to easily navigate related content via simple clicks.

To implement this hack you just need to open the single.php file in your theme and pasted following code within the loop. This code will display related posts based on the current post tag(s).

<?php
//for use in the loop, list 5 post titles related to first tag on current post
$tags = wp_get_post_tags($post->ID);  
if ($tags) {  
  echo 'Related Posts';  
  $first_tag = $tags[0]->term_id;  
  $args=array(  
    'tag__in' => array($first_tag),  
    'post__not_in' => array($post->ID),  
    'showposts'=>5,      'caller_get_posts'=>1 
  );  
  $my_query = new WP_Query($args);  
  if( $my_query->have_posts() ) {  
    while ($my_query->have_posts()) : $my_query->the_post(); ?>  
      <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>    
    <?php endwhile;  
  }  
}
?>

Source Link

 


Comment Page Related Hacks

 

04. Displaying Recent Comments

instantShift - Quality Wordpress Hacks

Recent comments are very helpful for readers to comment on any topic about any ongoing discussion. To display your most recent comments, you will have to modify your functions.php file from the theme folder. If the functions.php file is not present, make a new text file, name it functions.php and add it to your theme folder. Add the following code to it and save the file.

<?php
function recent_comments($src_count=10, $src_length=60, $pre_HTML='<ul>', $post_HTML='') {
global $wpdb;
$sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,
SUBSTRING(comment_content,1,$src_length) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC
LIMIT $src_count";
$comments = $wpdb->get_results($sql);
$output = $pre_HTML;
foreach ($comments as $comment) {
$output .= "<li><a href=\"" . get_permalink($comment->ID) . "#comment-" . $comment->comment_ID . "\" title=\"on " . $comment->post_title . "\">" . strip_tags($comment->com_excerpt) ."...</a></li>";
}
$output .= $post_HTML;
echo $output;
}
?>

Now, wherever you want to show the list of recent comments, just add this code.

<?php recent_comments(); ?>

Source Link

 

05. How to Display The Most Commented Posts in Specific Period

instantShift - Quality Wordpress Hacks

Many time it’s rather helpful to show most commented posts on your blog to make things easy for readers in selecting the most controversial or popular posts.

To display a list of your 10 most commented posts from some specific period, simply paste the following code on your blog sidebar, or anywhere on your theme.

NOTE: just change the “2008-01-01″ and “2008-12-31″ in line 4 to your desired starting and end date respectively to display the desired posts.


<h2>Most commented posts from 2008</h2>
<ul>
<?php
$result = $wpdb->get_results("SELECT comment_count,ID,post_title, post_date FROM $wpdb->posts WHERE post_date BETWEEN '2008-01-01' AND '2008-12-31' ORDER BY comment_count DESC LIMIT 0 , 10");

foreach ($result as $topten) {
  $postid = $topten->ID;
  $title = $topten->post_title;
  $commentcount = $topten->comment_count;
  if ($commentcount != 0) { ?>
    <li><a href="<?php echo get_permalink($postid); ?>"><?php echo $title ?></a></li>
  <?php }
} ?>
</ul>

Source Link

 



06. How to Separate WordPress Comments and Trackbacks

instantShift - Quality Wordpress Hacks

Trackbacks are the messages displayed in the comments list whenever another blog links back to one of your posts. If you use trackbacks on your blog, it is best if they are not mixed with the comments. The comments are a conversation between real people. Having machine-generated links in the middle of that will only serve to disrupt the conversations.

In order to separate the comments and trackbacks, you just need to follow these steps.

Open comments.php, and search for the following line

<?php foreach ($comments as $comment) : ?>

After it, paste the following

<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type == 'comment') { ?>

Now look for

<?php endforeach; /* end for each comment */ ?>

And before it, paste

<?php } else { $trackback = true; } /* End of is_comment statement */ ?>

Now your list of comments will continue to display as normal, but without any trackbacks or pingbacks. Now we will add a second comments loop for the trackbacks.

Look for the following line

<?php else : // this is displayed if there are no comments so far ?>

And before it, paste this: (The “Trackbacks” title line can be deleted if you don’t want a heading to be shown)

<?php if ($trackback == true) { ?>
  <h3>Trackbacks</h3>
  <ol>
  <?php foreach ($comments as $comment) : ?>
    <?php $comment_type = get_comment_type(); ?>
    <?php if($comment_type != 'comment') { ?>
      <li><?php comment_author_link() ?></li>
    <?php } ?>
  <?php endforeach; ?>
</ol>
<?php } ?>

Source Link

 


Images Related Hacks

 

07. Automatically Retrieve The First Image From Posts On Your Home Page

instantShift - Quality Wordpress Hacks

Traditionally, Most of the WordPress users using custom field to show the thumbs on the posts at their blog homepage. It’s easy to implement the custom field practice too but what if your blog automatically grab the first image from the post and you don’t need to worry about post main thumbnail. Sounds good idea to me at least.

To implement this hack open the functions.php file in your theme and paste this code in. Also, Don’t forget to specify a default image on line 10 (in case a post of yours does not have any single image).


function catch_that_image() {
  global $post, $posts;
  $first_img = '';
  ob_start();
  ob_end_clean();
  $output = preg_match_all('/<img .+src=[\'"]([^\'"]+)[\'"].*/>/i', $post->post_content, $matches);
  $first_img = $matches [1] [0];

 if(empty($first_img)){ //Defines a default image
  $first_img = "/images/default.jpg";
  }
  return $first_img;
}

Now, you can simply call the function within the loop to display the first image from the post.

<?php echo catch_that_image() ?>

Source Link

 

08. Automatically Get Images on Post Content

instantShift - Quality Wordpress Hacks

As i explained in earlier hack that the custom fields are one of the best options around to show images in your post, But it would be wonderful if there is some way to retrieving images embedded in the post’s content itself. Today is your lucky day as we have something to help you with.

To use this hack you just need to paste the following piece of code anywhere in your theme.


<?php if (have_posts()) : ?>
  <?php while (have_posts()) : the_post(); ?>

<?php
  $szPostContent = $post->post_content;
  $szSearchPattern = '~<img [^\/>]*\ />~';

// Run preg_match_all to grab all the images and save the results in $aPics
  preg_match_all( $szSearchPattern, $szPostContent, $aPics );

// Check to see if we have at least 1 image
  $iNumberOfPics = count($aPics[0]);

if ( $iNumberOfPics > 0 ) {
  // Now here you would do whatever you need to do with the images
  // For this example the images are just displayed
  for ( $i=0; $i < $iNumberOfPics ; $i++ ) {
  echo $aPics[0][$i];
  };
  };

endwhile;
endif;
?>

Source Link

 

09. How to Display a Random Header Image on Your WordPress Blog

instantShift - Quality Wordpress Hacks

It’s kind of ironic, if your header image changes automatically on every refresh. A lot of WordPress users seem to be very interested to keep the ability to show a random header image.

It’s not hard, it’s just very simple then you think. You just have to follow these simple steps.

  • Select some images which you want to display on header and name them 1.jpg, 2.jpg, 3.jpg and so on. There is no limit on number of images. select as many as you want.
  • Upload aa of your images into “wp-content/themes/yourtheme/images” directory of your WordPress.
  • Paste the following code in to your “header.php”
$num = rand(1,10); //Get a random number between 1 and 10, assuming 10 is the total number of header images you have
<div id="header" style="background:transparent url(images/.jpg) no-repeat top left;">
</div>

Source Link

 

10. How to Create Image Gallery in WordPress

instantShift - Quality Wordpress Hacks

Using Image gallery to display images associated with your blog is definitely a great idea, Even WordPress 2.5+ have inbuilt Image Gallery function where you can upload your images in a set and then insert the gallery either into your post or a new page. But what about the themes which working on older version then 2.5 or even some new themes which needs a good gallery to display the images.

In order to create a image gallery in your existing theme you need to do some modifications. First open the “single.php” in your theme folder and save it as “image.php” in same folder. Now open “image.php” and search the line which displays the post content. It should be somewhat in the following form. It can differ a bit but the function is called by the_content like this

<?php the_content('Read More'); ?>

Now insert the following code above the aforementioned code (the_content).

<p class="attachment">
  <a href="<?php echo wp_get_attachment_url($post->ID); ?>"><?php echo wp_get_attachment_image( $post->ID, 'medium' ); ?></a>
</p>
<div class="caption">
  <?php if ( !empty($post->post_excerpt) ) the_excerpt(); // this is the "caption" ?>
</div>

Also insert the following code below the aforementioned code (the_content).

<div class="imgnav">
<div class="imgleft"><?php previous_image_link() ?></div>
<div class="imgright"><?php next_image_link() ?></div>
</div>
<br clear="all" />

Now, add this CSS to your theme’s style.css file

/****************Image Gallery *********************/
.gallery {
      text-align: center;
}
.gallery img {
      padding: 2px;
      height: 100px;
      width: 100px;
}
.gallery a: hover {
      background-color: #ffffff;
}
.attachment {
      text-align: center;
}
.attachment img {
      padding: 2px;
      border: 1px solid #999999;
}
.attachment a: hover {
      background-color: #FFFFFF;
}
.imgnav {
      text-align: center;
}
.imgleft {
      float: left;
}
.imgleft a: hover {
      background-color: #FFFFFF;
}
.imgleft img {
      padding: 2px;
      border: 1px solid #999999;
      height: 100px;
      width: 100px;
}
.imgright {
      float: right;
}
.imgright a: hover {
      background-color: #FFFFFF;
}
.imgright img {
      padding: 2px;
      border: 1px solid #999999;
      height: 100px;
      width: 100px;
}

Now to use this gallery, just upload your images in a post or a page, go to the gallery option (after you have finished uploading all your images) and insert gallery into your post/page.

Source Link

 

11. How to Add a Print Button to Your Blog Posts

instantShift - Quality Wordpress Hacks

It’s a good practice to give your users a facility to print your blog posts. Of course user can print it directly via browser or keyboard shortcuts, but you can make this process easy to provide them a direct print button on the blog.

Just open up your single.php file (for individual posts) from the theme folder and add the following code wherever you want to have the Print option.

<a href="javascript:window.print()" rel="nofollow">Print this Article</a>

Source Link

 


Social Networking Related Hacks

 

12. How to Create A “Send To Facebook” Button

instantShift - Quality Wordpress Hacks

Everyone knows Facebook. No into needed. facebook is a very popular website to share the webpages you like with your friends. In order to increase your blog traffic, you should definitely add a “Share on Facebook” link to your blog.

To add this link, open the single.php file in your theme. And add the following code in the loop.

<a href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>&t=<?php the_title(); ?>" target="blank">Share on Facebook</a>

Else, you could use the getTinyUrl() function to send a short URL to Facebook.

<?php $turl = getTinyUrl(get_permalink($post->ID)); ?>
<a href="http://www.facebook.com/sharer.php?u=<?php echo $turl;?>&t=<?php the_title(); ?>" target="blank">Share on Facebook</a>

Source Link

 

13. How to Create a “Send to Twitter” Button

instantShift - Quality Wordpress Hacks

It’s also very simple to create a link that send your links to twitter where you can share your link with millions of users. Simply paste the following code on your single.php file, within the loop.

<a href="http://twitter.com/home?status=Currently reading <?php the_permalink(); ?>" title="Click to send this page to Twitter!" target="_blank">Share on Twitter</a>

Source Link

 

14. How to Automatically Post Daily Links from Del.icio.us to WordPress

instantShift - Quality Wordpress Hacks

There is a trick by which you can get more daily post on your blog than usual. Instead of simply posting every cool link you find onto your blog, you just need to do some tweaks by follow some simple steps from following article which can help you to have all your del.icio.us links automatically posted on your blog everyday.

Source Link

 


Author Related Hacks

 

15. Highlighting Author Comments in WordPress

instantShift - Quality Wordpress Hacks

It takes a bit of tweaking in order to separate the author’s comments from the readers’ comments. Usually it can be done by changing the color or style of the author’s comments. The trick is simple: instead of checking the author’s email address, check their user id to see if it’s the user id of the blog owner. Pretty smart. After that, it was a simple matter of times to see the result.

Open the “style.css” and near the bottom added these lines.

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

Open up the comments.php file from your theme folder and try to locate the following code.

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

Replace the above code with this.

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

Source Link

 

16. Add Author Info With Every Blog post

instantShift - Quality Wordpress Hacks

Displaying author bio inside a post is a great idea. Specially, for the guest authors which seriously want to spread their words around. You might not found this useful for single user blogs. But for multi-authored blogs, It’s often useful to put author description in the end of the respective post so the readers can know who that person is without having to refer to an about me page.

So let’s see how it goes. Inside of an every user profile there is this section where you can place information about yourself. Just add the author info you want to display in it.

Open your Style sheet and add this to it.

.postauthor {
}

Now browse to your themes “index.php” file and look for something like this.

<?php the_content('Read the rest of this entry »'); ?>

Just place following code below the above function.


<div class="postauthor ">
    <?php the_author_description(); ? >
</div>

It’ll do the trick and you have author bio in place. Now you can style it with different combination from your Style sheet. Here’s one example.

.postauthor {
      color: #222222;
      font-family: Arial, Helvetica, sans-serif;
      font-size: 14px;
      font-weight: normal;
      background: #EAEAEA;
      border-top: 2px solid #000000;
      border-bottom: 1px solid #000000;
      width: 640px;
      padding: 3px;
      margin-bottom:5px;
}

Source Link

 

17. Listing All the Authors from Your Blog

instantShift - Quality Wordpress Hacks

Just as we mentioned above that for multi-authored blogs, It’s often useful to put authors description in the end of the respective post. And it’s even more useful for readers to put the list of all the blog authors on your WordPress blog if anyone wants to follow any specific author. You just need to place following code anywhere you want to display the list.

    <?php wp_list_authors('exclude_admin=0&optioncount=1&show_fullname=1&hide_empty=1'); ?>

You also can tweak the parameters to adjust the display.

  • exclude_admin: 0 (include the admin’s name in the authors list) / 1 (exclude the admin’s name from the list)
  • optioncount : 0 (No post count against the author’s name) / 1 (display post count against the author’s name)
  • show_fullname : 0 (display first name only) / 1 (display full name of the author)
  • hide_empty : 0 (display authors with no posts) / 1 (display authors who have one or more posts)

Source Link

 


Feeds Related Hacks

 

18. Display the Feedburner Subscriber Count in Text

instantShift - Quality Wordpress Hacks

Are you using feedburner? Probably yes, Most of us do. If you don’t like the chicklet dedicated to display your feedburner count, just read this hack which is a new method to get your feedburner count in text mode.

Copy paste the following code into your theme, for example sidebar.php. Replace feedburner-id with your Feedbuner username. This script will grab you the feed count in numbers.


//get cool feedburner count
$whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=feedburner-id";

//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

Now paste this anywhere you want and it’ll display a Feedburner subscriber count in text.

echo $fb;

Source Link

 

19. Control When you want Your Posts to Be Available via RSS

instantShift - Quality Wordpress Hacks

Most of you must of faced this problem when you published a post and immediately noticed an error and then you edit it as soon as you can. But the problem is the post already been published in your RSS feed and your error been quite a visible to your feed readers. The smart solution to this problem is to have an ability to control the way your posts going to available for RSS readers. You just need to create a delay between the publication of a post and its availability in your RSS feed.

Now open the “function.php” file and paste the following code into it. If your theme doesn’t have “function.php” file then just create it.


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');

Now applying this, your feed will be published always 5 minutes later. Of course you can adjust the time, also the units, if you need it in a special case.

Source Link

 

20. How to Exclude Categories from Your RSS Feed

instantShift - Quality Wordpress Hacks

There is no point of using one of your blog categories to let readers know about your blog’s news, or your blog feature a category that has nothing to do with the rest of your content? Depending to your blog structure, it may be interesting to exclude some categories from your RSS feeds.

Just follow these steps to get rid of one of the categories in your RSS feed.

  • In orser to start, You’ll have to know the numeric ID of the categories you want to exclude. If you dont know how to identify the numeric ID the just logged in your WordPress dashboard, and browse the Categories section. Simply put your mouse cursor on the “edit” link related to the category you want to know the ID and look on your browser’s status bar the numeric value which appear at the very last of respective url and comes just after “cat_ID=”.
  • Once you have the ID of the category you want to exclude from your RSS feed, Open the “function.php” file and paste the following code into it and save it. If your theme doesn’t have “function.php” file then just create it.

function myFilter($query) {
  if ($query->is_feed) {
    $query->set('cat','-5'); //Don't forget to change the category ID =^o^=
  }
  return $query;
}

add_filter('pre_get_posts','myFilter');

Source Link

 

21. How to Create User-Defined RSS Feeds in WordPress

instantShift - Quality Wordpress Hacks

It’s no secret that RSS feed are very useful for blogs. There is no harm in using WordPress created feeds as they are very effective. But if you want to create your own custom RSS feed, in which you have ability to control everything starting from feed categories to feeds display then simply follow these steps.

  • copy and paste the following code in a new file, save it under the name custom-feed.php and upload it on your theme directory.
  • Now, Create a new page in WordPress Dashboard (Don’t type any text it in), and select custom-feed.php as a page template.

<?php
  /*
  Template Name: Custom Feed
  */

$numposts = 5;

function yoast_rss_date( $timestamp = null ) {
  $timestamp = ($timestamp==null) ? time() : $timestamp;
  echo date(DATE_RSS, $timestamp);
  }

function yoast_rss_text_limit($string, $length, $replacer = '...') {
  $string = strip_tags($string);
  if(strlen($string) > $length)
  return (preg_match('/^(.*)\W.*$/', substr($string, 0, $length+1), $matches) ? $matches[1] : substr($string, 0, $length)) . $replacer;
  return $string;
  }

$posts = query_posts('showposts='.$numposts);

$lastpost = $numposts - 1;

header("Content-Type: application/rss+xml; charset=UTF-8");
  echo '<?xml version="1.0"?>';
  ?><rss version="2.0">
  <channel>
  <title>Yoast E-mail Update</title>
  <link>http://yoast.com/</link>
  <description>The latest blog posts from Yoast.com.</description>
  <language>en-us</language>
  <pubdate><?php yoast_rss_date( strtotime($ps[$lastpost]->post_date_gmt) ); ?></pubdate>
  <lastbuilddate><?php yoast_rss_date( strtotime($ps[$lastpost]->post_date_gmt) ); ?></lastbuilddate>
  <managingeditor>joost@yoast.com</managingeditor>
  <?php foreach ($posts as $post) { ?>
    <item>
    <title><?php echo get_the_title($post->ID); ?></title>
    <link><?php echo get_permalink($post->ID); ?></link>
    <description><?php echo '<![CDATA['.yoast_rss_text_limit($post->post_content, 500).'<br /><br />Keep on reading: <a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a>'.']]>';  ?></description>
    <pubdate><?php yoast_rss_date( strtotime($post->post_date_gmt) ); ?></pubdate>
    <guid><?php echo get_permalink($post->ID); ?></guid>
    </item>
  <?php } ?>
  </channel>
  </rss>

Source Link

 

22. Adding a “Subscribe to Feed” Message After Every Post

instantShift - Quality Wordpress Hacks

As we described above that RSS feed are very popular and powerful tool for your blogs readers. It’s very useful to keep remind the readers to subscribe to your blogs. There is no harm in it, Infect readers love to subscribe your RSS feed if it’s more visible and clearly aiming towards point.

If you want the message “Subscribe to Feed” to display under all your posts on the homepage then open “index.php” and just where your content finishes (the_content), add this code.

<div style="padding:5px; background-color:#FFF8AF;">
  If you enjoyed this post, make sure you subscribe to our RSS Feed
</div>

If you also want to display this message in your every post then open “single.php” file in the theme folder and add the above code.

Source Link

 


Find Something Missing?

Please feel free to share any hack that you think would be a great addition in this collection and that has not been listed already.




Author : Anders Ross

I'm a co-founder of iShift as well as a freelance designer and a web addict in Frankfurt, Germany. I spend too much time in front of the computer and when I actually manage to get away for more than 10 minutes, I am usually reading books, traveling or shooting photos. Check the latest updates of iShift @instantShift or You can catch me on twitter @indusLogic

32 Articles posted by Anders Ross.
gravatar

If you enjoyed reading, consider sharing it on one of these social bookmarking sites.


RSS Enjoy this Post? Subscribe to InstantShift.

RSS Feed   RSS Feed     Email Feed  Email Feed



Leave a Comment Subscribe to RSS Feed Subscribe by Email
  1. Gravatar Tutorial City June 15, 2009

    Comment Arrow

    Awesome list!!


  2. Gravatar John Hoff - WpBlogHost June 15, 2009

    Comment Arrow

    Great list. I like the idea that you can do these without the use of a plugin. Makes things work quicker and is more secure.


  3. Gravatar Nick - Freelancer June 15, 2009

    Comment Arrow

    Excellent, there are a few here that I have been looking for, and now I find them all together in the one spot! Cheers. Thats a great help.


  4. Gravatar Decent Weblog June 15, 2009

    Comment Arrow

    Thanks for the beautiful tips :)


  5. Gravatar Danh ba web 2.0 June 15, 2009

    Comment Arrow

    Awesome WP hacks, thanks for sharing


  6. Gravatar Rumoi June 15, 2009

    Comment Arrow

    Nice article!

    But, some codes may contain problems because of Syntax-Highlighter.
    Less-than signs turn into %3C on 5, 9, 12 and more.
    (I think all of less-than signs next to question marks have problems)
    I hope you check again and fix it.


  7. Gravatar Roseli A. Bakar June 15, 2009

    Comment Arrow

    Awesome Tips !!

    Thanks


  8. Gravatar WpDite June 15, 2009

    Comment Arrow

    Awesome! Always love any posts about WordPress. Thanks.


  9. Gravatar Thomas June 15, 2009

    Comment Arrow

    Yes, a very useful list with haks. thanks. I am looking for a hack where i can change the background-color of every Post when you open the Post. You may know of such a comment. Greetz Tom


  10. Gravatar Kai June 15, 2009

    Comment Arrow

    very usefull. many thanks


  11. Gravatar arvind June 15, 2009

    Comment Arrow

    great list. Thanks!


  12. Gravatar tasarhane June 15, 2009

    Comment Arrow

    hey these are absolutely awesome infos..
    thanks.


  13. Gravatar Patternhead June 15, 2009

    Comment Arrow

    Hadn’t seen a couple of these. Thanks for sharing :D


  14. Gravatar Philip Ze June 15, 2009

    Comment Arrow

    Excellent guide, I spend months to look for some of the codes. Finally it is all here.


  15. Gravatar Ted June 15, 2009

    Comment Arrow

    Terrific list. I am new to all of this, so the article speaks to me.

    One question – If I understand it properly, the new WordPress 2.8 has an automatic update feature. If I use it and I have these hacks in place, will they be kept with the updating, or do I need to re-install them after that?

    Thanks in advance for the help.


  16. Gravatar Gennice June 15, 2009

    Comment Arrow

    Great ones! I am definitely going to use some of these!

    Thanks.


  17. Gravatar John Hoff - WpBlogHost June 15, 2009

    Comment Arrow

    @Ted – Upgrades shouldn’t affect any of these. As long as you’re working within your /wp-content/ folder nothing will change as a result of an upgrade.

    These hacks will mostly all be in your wp-content/theme directory.


  18. Gravatar Satbir June 15, 2009

    Comment Arrow

    Hi Anders, this one is really nice and comprehensive list of wordpress hacks.

    Regarding 06 – separating comments and trackbacks, i’d like to add that since WordPress 2.7, it also includes a function wp_list_comments() which can be used to show comments or trackbacks. e.g. to show only comments use wp_list_comments(’type=comment’) and for trackbacks, use wp_list_comments(’type=ping’).


  19. Gravatar TELEVISION Spy June 15, 2009

    Comment Arrow

    Great list, will try some out.


  20. Gravatar Amit June 15, 2009

    Comment Arrow

    This is definitely one of the most amazing blogs post on wordpress hacks I have read in recent times, also just dugg it for you.


  21. Gravatar iwpdesign June 16, 2009

    Comment Arrow

    WOW. Very nice tips. Useful for my next wordpress theme :) Thanks.


  22. Gravatar Scott June 16, 2009

    Comment Arrow

    The explanation of #8 is vague … I’m not getting what you’re doing with that one.


  23. Gravatar schraegschrift June 16, 2009

    Comment Arrow

    Good one.


  24. Gravatar bitlimakina June 16, 2009

    Comment Arrow

    thanks for best practice.


  25. Gravatar Markus June 16, 2009

    Comment Arrow

    Wow, thanks for that great post! I Have to try some of these hacks…


  26. Gravatar Chetan Madaan June 16, 2009

    Comment Arrow

    WOW! this is amazing!


  27. Gravatar izioSEO June 16, 2009

    Comment Arrow

    Oh wow, I need some of these nice hacks tomorow :D … absolute beautiful …


  28. Gravatar Clare June 16, 2009

    Comment Arrow

    WOW. Very nice tips. Useful for my next wordpress theme Thanks..


  29. Gravatar Livia June 16, 2009

    Comment Arrow

    This is really really really useful. Thanks!


  30. Gravatar Amitbhawani June 16, 2009

    Comment Arrow

    a nice list of hacks there its very useful ,
    of of these hacks makes your blog looks cleaner then ever


  31. Gravatar Yoosuf June 16, 2009

    Comment Arrow

    hmmm cool


  32. Gravatar sunil June 16, 2009

    Comment Arrow

    Very interesting. Instead of all these functionality we had to use plugins. Now we can use these hacks. Thanks a lot for sharing this


  33. Gravatar Joomla Experts June 16, 2009

    Comment Arrow

    Nice guys!


  34. Gravatar belladaze June 16, 2009

    Comment Arrow

    Exactly what I needed to learn . . . many thanks.


  35. Gravatar Elizabeth K. Barone June 16, 2009

    Comment Arrow

    A lot of these were things I’ve often seen and would love to implement on some of my own sites. Thank you, thank you, thank you! :D


  36. Comment Arrow

    Awesome Post Anders Ross,
    These type of Hacks/Tweaks make wordpress what it is, The best blogging platform in the world. My hat off to you sir!

    thank you


  37. Gravatar Richard Niemand June 18, 2009

    Comment Arrow

    Freaking awesome post :)


  38. Gravatar PelFusion June 20, 2009

    Comment Arrow

    thanks…i was looking for How to Separate WordPress Comments and Trackbacks to implement on my blog


  39. Gravatar Phaoloo June 20, 2009

    Comment Arrow

    Awesome hacks. Some are really new to me.


  40. Gravatar hkarthi June 20, 2009

    Comment Arrow

    great article, would try some of it for sure!


  41. Gravatar shoaib786 June 22, 2009

    Comment Arrow

    thanks for your recommended sources,
    i really appreciated for this post..Thanks!


  42. Gravatar Daniel Accorsi June 23, 2009

    Comment Arrow

    Excelent!!! All I needed!
    Thanks…


  43. Gravatar Christian Coquet June 24, 2009

    Comment Arrow

    Dude, this post is a gold mine :) thanks


  44. Gravatar Cre8ive Commando June 24, 2009

    Comment Arrow

    Nice, I look forward to trying some of these hacks out. Here is another useful hack that allows you to Use WordPress Conditional Tags to Hack Your Theme.

    http://wphacks.com/wordpress-conditional-tags-hack-theme/


  45. Gravatar ian June 25, 2009

    Comment Arrow

    Title had me puzzled at first! A mix of 22 quality wordpress hacks or 22 hacks of mixed quality ;-)


  46. Gravatar Michael Clements June 26, 2009

    Comment Arrow

    Great tips. Thanks for sharing.


  47. Gravatar Christopher Hennis June 26, 2009

    Comment Arrow

    Nice post; However, the trackback seperation from normal comments ‘hack’ no longer works on Wordpress 2.8. It destroys paged comment navigation.


  48. Gravatar Reviews July 2, 2009

    Comment Arrow

    Thanks for sharing.great job.


  49. Gravatar Phaoloo July 4, 2009

    Comment Arrow

    Nice hacks


  50. Gravatar Justin Wright July 4, 2009

    Comment Arrow

    Awesome list here. I learned a ton of different things that I plan to implement into some of our blogs.

    Great work!


  51. Gravatar takien July 7, 2009

    Comment Arrow

    Awesome, thanks :)


  52. Gravatar ithemesdotnet July 9, 2009

    Comment Arrow

    Awesome stuff here. Thanks for putting this list together!


  53. Gravatar Wordpressthemegenerator July 13, 2009

    Comment Arrow

    Excellent, there are a few here that I have been looking for. Thanks


  54. Gravatar Abu Farhan July 15, 2009

    Comment Arrow

    Thanks for the tips, I looking for around how to search image from the post.


  55. Gravatar borntobeaseo July 15, 2009

    Comment Arrow

    Really awesome list!!
    I love the “How to Add a Print Button to Your Blog Posts” hack.
    Thank you very much!


  56. Gravatar Silko Vogt July 16, 2009

    Comment Arrow

    Great Stuff! Thank you very much. It´s a MUST for everyone who use Wordpress as CMS.


  57. Gravatar Thomas July 24, 2009

    Comment Arrow

    This are nice code snippetss


  58. Gravatar andibandaro July 28, 2009

    Comment Arrow

    Nice info, I will try it on my page.. thx


  59. Gravatar Como criar um blog August 3, 2009

    Comment Arrow

    Great Job
    It must have taken about a month to grabe all taht info?
    Thanks for sharing


  60. Gravatar Kamal Hasa August 12, 2009

    Comment Arrow

    This is like an awesome post of best hacks. Thanks for sharing..


  61. Gravatar Rebecca August 14, 2009

    Comment Arrow

    Hack #15 isn’t working for me, and I am using one of your themes! (Christmas). I adore your themes, but couldn’t get the hacks to “work.” Got any suggestions??


  62. Gravatar welcome August 14, 2009

    Comment Arrow

    wow.is too great.thanks!


  63. Gravatar Deluxdon August 14, 2009

    Comment Arrow

    Wonderful sharing. Thanks for added all together.

    DON.


  64. Gravatar Michael Mior September 27, 2009

    Comment Arrow

    In hack #9, you left out the output $num into the HTML.


  65. Gravatar SEO Rab October 2, 2009

    Comment Arrow

    WOW! this is amazing!
    no plugins there


  66. Gravatar Niche Website Builder October 7, 2009

    Comment Arrow

    Great hacks! While I may not enjoy writing code, I sure do enjoy customizing it and getting my hands dirty when necessary.


  67. Gravatar Maxx52 October 23, 2009

    Comment Arrow

    None of this discussion is meant to impugn the general practice of credit, which has an important and vital function on the free market. ,


  68. Gravatar Cottelletje November 1, 2009

    Comment Arrow

    Hello can anybody help me get an avatar : comment style like this one. please mail me the code if you can. would be very happy to get some response. i want my avatar to be next to my comment,on my theme i use this isn’t so…


  69. Gravatar Rank On Top November 3, 2009

    Comment Arrow

    Very Cool tools its places like this that make sharing worth it!


  70. Gravatar Celeb News November 11, 2009

    Comment Arrow

    Hey man…This is a great post!

    You guys can check out some of these features being used on

    http://celebblvd.com

    or if that link doesn’t work check out the posts on…

    Celeb News


  71. Gravatar Ken November 12, 2009

    Comment Arrow

    I’m making a new site and have a question regarding “popular posts”. You describe above in topic #2 about the code for popular posts. However, once you’re set up with the code how do you assign in wordpress admin which posts will be “popular” and which posts will not. Is there some way to assign a post to “popular” as you’re creating it?

    Kind Regards,
    Ken


  72. Gravatar Michael Mior November 12, 2009

    Comment Arrow

    @Ken The posts that are displayed will be those with the highest number of comments. If you wanted to select these manually, you could add a custom field to your posts and then modify the query in the code above to select posts with this field set.


  73. Gravatar Ken November 12, 2009

    Comment Arrow

    Thanks Michael. Would you mind giving an example of how the query in the code would be modified to select posts with a given field set? Let say we specify the custom field set to be “popular”.

    Kind Regards,
    Ken


  74. Gravatar chris November 21, 2009

    Comment Arrow

    thank you, I’ll try this on my blog.


  75. Gravatar Alek November 21, 2009

    Comment Arrow

    Hey man, these are some great hacks, however, you might want to update the “Get Feedburner Count” one .. Google has changed their url to
    https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=yourfeedurl

    And even with that in mind, I still can’t get it to work for me. Weird.

    Thanks a lot, anyways. Once again, great list!


  76. Gravatar Carik December 6, 2009

    Comment Arrow

    Good selection. There are some options on other sites, but not completely. Some hacks are in the standard functionals of the following versions of WordPress. Thank you.


  77. Gravatar diwhflq January 4, 2010

    Comment Arrow

    need Help? I need to know how to design my own wordpress theme? | WordPress Styles


  78. Gravatar sharath January 5, 2010

    Comment Arrow

    awesome list….. no need of plugins :D very handy…



  Leave a Trackback
  1. 22 Mixed Quality Wordpress Hacks | Tutorials | instantShift | Neorack Script
  2. » 22 Mixed Quality Wordpress Hacks | Tutorials | instantShift Wordpress Plugins: Just another WordPress weblog
  3. 22 Mixed Quality Wordpress Hacks | Tutorials | instantShift
  4. 22 Mixed Quality Wordpress Hacks | Tutorials | instantShift | WEBMASTERLIB.COM
  5. CSS Brigit | 22 Mixed Quality Wordpress Hacks
  6. Free WordPress Plugin - Click-Track | Make Money Online With Internet Marketing
  7. My Favorite Design Links of the Week | eGrace Creative Web Solutions
  8. 22 Mixed Quality Wordpress Hacks | Tutorials | instantShift « Netcrema - creme de la social news via digg + delicious + stumpleupon + reddit
  9. popurls.com // popular today
  10. links for 2009-06-15 « On New Media
  11. 22 Mixed Quality Wordpress Hacks | Tutorials | instantShift
  12. Lady Antebellum - I Run To You [ Music Video + Lyrics + Download ] | Running workout information
  13. Wordpress News - 22 Mixed Quality Wordpress Hacks
  14. links for 2009-06-15 | BlueWave Media
  15. 22 Mixed Quality Wordpress Hacks | Tutorials | instantShift
  16. 22 Mixed Quality Wordpress Hacks | Design Newz
  17. links for 2009-06-15 « Rob Parker – robparker.org.uk
  18. Tips on How to Get Your Ex Boyfriend Back - What You Must Do | Online Dating Advice
  19. microbiablog.com
  20. 22 Mixed Quality Wordpress Hacks
  21. Critical Questions For eCommerce Web Development | Internet Marketing
  22. 22 Wordpress Hacks | tekka.de
  23. Around The Intewebs with (jeff)isageek – June 15th | (jeff)isageek.net
  24. 22 hacks de alta calidad para Wordpress - diarioTHC, recursos para webmasters, bloggers y diseñadores.
  25. links for 2009-06-15
  26. justbecos I like them: issue #4 » justbecos.com
  27. links for 2009-06-15 « Mandarine
  28. links for 2009-06-16 | Emrah Sağlık
  29. - leg med nye medier. Eller noget.
  30. Noch mehr WordPress-Links – Der Schockwellenreiter
  31. Making your site unique « WordPress Sux
  32. links for 2009-06-16 « Boskabout
  33. Useful WP hacks « 0ddn1x: tricks with *nix
  34. 10 things to learn on June 18th
  35. More Free Stuff… | v-2.org
  36. Sket på nettet den 18.06.09
  37. Wordpress Hacks - Warez Forum-ZiY
  38. How to Turn your iPod into a Taser
  39. 4 enkla WordPress hacks! | wpxl
  40. fritz freiheit.com blog » Link dump
  41. Il meglio della settimana #22 | BigThink
  42. Weekly WebTrends #1 | TechAwe
  43. The Great Geek Manual » Link Round-Up: June 15, 2009
  44. WordPress & Blogging Articles for june 16 2009 | WPStart.org - WordPress themes, plugins and news
  45. delicious-Linkdump vom 29.6.2009 | EGM Weblog
  46. links for 2009-06-29 | EGM Weblog
  47. How To Secure Wordpress | Billy Ojai
  48. Comment on 22 Mixed Quality Wordpress Hacks by Thomas | wpden
  49. 22 Mixed Quality Wordpress Hacks | Tutorials | instantShift
  50. 22 Mixed Quality Wordpress Hacks | Tutorials | instantShift
  51. 300+ Resources to Help You Become a WordPress Expert | huibit05.com
  52. Blog – Velagapati - 300+ Resources to Help You Become a WordPress Expert
  53. 30 Incredibly Useful WordPress Hacks | Tutorial9
  54. Amazing Wordpress Hacks collection to assist you to become a Wordpress maestro - BLOGTECHNIKA
  55. 30 Incredibly Useful WordPress Hacks | huibit05.com
  56. Formation à distance » Blog Archive » Blogs
  57. NamrouD | Upgrade Your Mind ! » 30 Incredibly Useful WordPress Hacks
  58. 300+ Resources to Help You Become a WordPress Expert « eBSPAD
  59. Wordress Hacks Collected | CSS Collections | Masterful CSS Collections
  60. 30 Incredibly Useful WordPress Hacks « AnaConda 4 Photoshop Blog
  61. 300+ Resources to Help You Become a WordPress Expert | LeVoltz - iPhone Games, Engineering Projects, Wordpress Themes
  62. 22 Latest Exceptional WordPress Hacks | Programming Blog
  63. I need Help? I need to know how to design my own wordpress theme? | WordPress Styles
  64. Wordpress Hacks & Tricks – A grande lista  | 2.0 Webmania
  65. Top 10 list of lists | Pingable :: Everything Wordpress

  • Gravatar

    Your NameJanuary 21, 2010

Arrow
Spam protection: Sum of 3 + 7 ?



If you face problem with captcha and it says the sum is incorrect. Make sure...

1. Browser is javascript enabled and accepting cookies.
2. Clear browser cache and try again.



http://www.instantshift.infohttp://www.instantshift.orghttp://www.instantshift.net