Three WP Recipes WordPress Blog Hacks



I’m so much in love with the blog WP Recipes as they are so innovative with their wordpress hacks. Here are 5 of their hacks that I find so uber uber hot

1. How to Display your feedburner count in full text
Simply add the code to your sidebar.php file or if you use the wordpress plug-in EXEC-PHP, add it to a sidebar text widget.

<? php
$fburl=”https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=YourURL“;
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $fburl);
$stored = curl_exec($ch);
curl_close($ch);
$grid = new SimpleXMLElement($stored);
$rsscount = $grid->feed->entry['circulation'];
echo $rsscount;
?>

Save it and you’re good to go.
Credit: How to Display your feedburner count in full text

2. How To Control When Your Posts Are Available Via RSS.
I love this hack cos it prevents my readers from getting last minute mistakes in my blog posts. Your theme MUST have a functions.php file to implement this hack. If it doesn’t, create one.

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

Paste the code above into your functions.php file before the ending tag, ?>. The parts in red determine when your posts are made available via rss. For example, in the code above it’s set to 5minutes after post has been published.
You can modify this number to minutes, hours etc.
Credit: How to: Control when your posts are available via rss

3. How to List Scheduled Posts
I always take a day or two out in a month to draft at least 10 blog posts for the upcoming month that way even if I’m very busy with work at the hospital, my blog stays updated with fresh content.
I also like showing my readers what’s coming next on my blog so as to peak their interest and even get them to subscribe to my feed. This hack has seen my feed subscribers rising slowly unlike before when it was absolutely STAGNANT.

<?php
$my_query = new WP_Query(’post_status=future&order=DESC&showposts=5′);
if ($my_query->have_posts()) {
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID; ?>
<li><?php the_title(); ?></li>
<?php endwhile;
}
?>

Paste the code wherever you want it to appear in your theme and you’re done. Personally I prefer it been displayed in a sidebar widget. For that make sure, your have EXEC-PHP installed like Hack No. 1.

As an alternative, you can simply paste it in the sidebar.php file.

I recommended changing DESC to ASC so that the post in the top of the list will be the first to be published. You can also change the number of scheduled posts to show.
Credit: How to List scheduled posts

Hope you all benefit from these wonderful hacks. Feel free to share links to more amazing hacks below.



2012 Top Laptops, Desktops and Tablets

Related Articles You May Like To Read
  1. Adsense For Mobile Content WordPress Setup Guide
  2. How To Fix WordPress RSS Feed Summary/Excerpt
  3. How To Remove The Navigation Bar In Blogger
  4. How To Unlock Your Huawei – ZTE USB Modem Online
  5. How To Fix WordPress For BlackBerry Server Communication Error


Disclosure: Please note that each time you make a purchase via any referral link on this site, I make a commission. Click here for more info.


One Comments so far. Leave Yours Below

If you want to ask a question regarding anything, do please make use of the floating search bar at the bottom of this site. If you don't find what you're looking for, then feel free to ask your question

ALL COMMENTS WITH KEYWORDS AS NAMES WILL BE DELETED! TAKE NOTE!


Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.


  1. Joy Stone says:

    Thanks for posting this one. The codes are working well.