'sidebar',
'name' => 'sidebar',
'before_widget' => '
',
'after_widget' => '',
'before_title' => '',
'after_title' => '
'
));
}
add_action( 'widgets_init', 'LovelyAnimals_register_sidebar');
/*
* @uses add_theme_support() To add support for post thumbnails and automatic feed links.
*/
function LovelyAnimals_setup() {
// Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories.
// This theme uses post thumbnails
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 116, 86, true );
// Add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image' ) );
register_nav_menus( array(
'primary' =>'Primary Menu',
) );
}
add_action( 'after_setup_theme', 'LovelyAnimals_setup' );
if ( ! isset( $content_width ) )
$content_width = 665;
function LovelyAnimals_hotfriends(){
global $wpdb;
$counts = $wpdb->get_results("SELECT COUNT(comment_author) AS cnt, comment_author, comment_author_url, comment_author_email
FROM {$wpdb->prefix}comments
WHERE comment_date > date_sub( NOW(), INTERVAL 1 MONTH )
AND comment_approved = '1'
AND comment_author_email != 'example@example.com'
AND comment_author_url != ''
AND comment_type = ''
AND user_id = '0'
GROUP BY comment_author_email
ORDER BY cnt DESC
LIMIT 15");
$mostactive = '';
if ( $counts ) {
foreach ($counts as $count) {
$c_url = $count->comment_author_url;
$mostactive .= ''.'' . get_avatar($count->comment_author_email, 55, '', $count->comment_author . ' reply on ' . $count->cnt . '') . ''.$count->comment_author.'';
}
echo $mostactive;
}
}
function LovelyAnimals_excerpt_more($more) {
global $post;
return '
Read the Rest...';
}
add_filter('excerpt_more', 'LovelyAnimals_excerpt_more');
function LovelyAnimals_scripts(){
if ( is_singular() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'LovelyAnimals_scripts' );
// filter function for wp_title
function LovelyAnimals_filter_wp_title( $old_title, $sep, $sep_location ){
// add padding to the sep
$ssep = ' ' . $sep . ' ';
// find the type of index page this is
if( is_category() ) $insert = $ssep . 'Category';
elseif( is_tag() ) $insert = $ssep . 'Tag';
elseif( is_author() ) $insert = $ssep . 'Author';
elseif( is_year() || is_month() || is_day() ) $insert = $ssep . 'Archives';
else $insert = NULL;
// get the page number we're on (index)
if( get_query_var( 'paged' ) )
$num = $ssep . 'page ' . get_query_var( 'paged' );
// get the page number we're on (multipage post)
elseif( get_query_var( 'page' ) )
$num = $ssep . 'page ' . get_query_var( 'page' );
// else
else $num = NULL;
// concoct and return new title
return $insert . $old_title . $num ;
}
add_filter( 'wp_title', 'LovelyAnimals_filter_wp_title', 10, 3 );
function LovelyAnimals_comment_reply_script() {
if ( comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'comment_form_before', 'LovelyAnimals_comment_reply_script' );
?>