<?php
global $wpdb;
$commentQuery = "SELECT * from $wpdb->comments WHERE comment_approved= '1'
ORDER BY comment_date DESC LIMIT 0 ,5";
$comments = $wpdb->get_results($commentQuery);
foreach ($comments as $comment) {
$url = '<a href="'. get_permalink($comment->comment_post_ID).
'#comment-'.$comment->comment_ID .'">';
?>
<li><?php echo $url; ?><?php echo $comment->comment_author; ?> On
<?php echo get_the_title($comment->comment_post_ID); ?></a></li>
<?php } ?>
Category Archives: Wordpress
Wordpress
WordPress function that shows archives
<?php
$args = array(
'type' => 'monthly',
'format' => 'html',
'show_post_count' => false,
'echo' => 1 );
echo wp_get_archives( $args );
?>
wordpress function that shows popular tags
<?php
$args = array(
'smallest' => 8,
'largest' => 22,
'unit' => 'pt',
'number' => 45,
'format' => 'flat',
'orderby' => 'name',
'order' => 'ASC',
'exclude' => null,
'include' => null,
'topic_count_text_callback' => default_topic_count_text,
'link' => 'view',
'taxonomy' => 'post_tag',
'echo' => true );
wp_tag_cloud( $args );
?>
Display post added month – WordPress
the_time('l, F jS, Y')
Function that displays post author – WordPress
<?php the_author() ; ?>
How to get the site name – Wordpres
<?php
echo bloginfo('name');
// Site name
?>
How to get the site description – Wordpres
<?php
echo bloginfo('description');
// Site description
?>
How to get the charset used in the wordpress site
<?php
echo bloginfo('charset');
// Site charset
?>
How to get the text vesrion of wordpress
<?php
echo bloginfo('version');
// WordPress version
?>
How to get the vesrion of wordpress
<?php echo bloginfo('version'); // WordPress version ?>Or else load the page wp-includes > version.php and find ot the following line:$wp_version = '2.8.4';