almost 2 years ago
Want to display human readable dates on your blog, such as “Posted 6 days ago?” There’s a lot of available functions to do so, but only a few people know that WordPress have its own built-in function to do that.
To display human readable dates on your blog, you have to use the human_time_diff() function. The following piece of code will show a post date like “Posted 6 days ago”.
Paste it anywhere within the loop, save the file, and you’re done.
Posted <?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?>
almost 2 years ago
Little code snippet for showing amount of comment a comment author made. I saw a really cool thing on ProBlogDesign. In the comments there is also the amount of comments the comment authors made. Here is a screenshost. Showing Amount Of Comments A Comment Author Made Here is a function you can use to get and echo the number of comments a comment author made. Put it in the functions.php file in your theme.
function commentCountAuthor(){
$oneText = 'One comment';
$moreText = '%...
almost 2 years ago
Introduced in WordPress 2.9, get_the_post_thumbnail() allow you to display a thumbnail in your posts. But what about displaying post thumbnails in RSS feeds? Just read this recipe to know how to do.
Simply paste the following code in your functions.php file. The post thumbnail should be visible once you saved the file.
<pre>function diw_post_thumbnail_feeds($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = '<div>' . get_the_post_thumbnail($post->ID) . '</div>' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'diw_post_thumbnail_feeds
almost 2 years ago
Bollywood's Most Beautiful Actress Reigning steady at the Numero Uno position – Kareena Kapoor was recently voted as India’s Most Beautiful Woman by the People Magazine. Kareena Kapoor, who features on the cover of the magazine credits her beauty to her fitness regime and her diet. The issue that takes readers through her growing up years also touches on questions like ‘When does she feel the most beautiful.’ Says Kareena Kapoor in an exclusive interview with People Magazine, “I believe that...