Example #1
0
function postviews_page_general_stats($content)
{
    $stats_display = get_option('stats_display');
    if ($stats_display['views'] == 1) {
        $content .= '<p><strong>' . __('WP-PostViews', 'wp-postviews') . '</strong></p>' . "\n";
        $content .= '<ul>' . "\n";
        $content .= '<li>' . sprintf(_n('<strong>%s</strong> view was generated.', '<strong>%s</strong> views were generated.', get_totalviews(false), 'wp-postviews'), number_format_i18n(get_totalviews(false))) . '</li>' . "\n";
        $content .= '</ul>' . "\n";
    }
    return $content;
}
Example #2
0
	
	<div class="block">
		<h3>站点统计</h3>
		<li>文章数:<?php 
$count_posts = wp_count_posts();
echo $published_posts = $count_posts->publish;
?>
</li>
		<li>评论数:<?php 
$total_comments = get_comment_count();
echo $total_comments['approved'];
?>
 </li>
		
		<li>访问量:<?php 
get_totalviews(true, true, true);
?>
 </li>
		
	</div>

<?php 
if (is_home() && !is_paged()) {
    ?>
<div class="block">
<h3>友情链接</h3>
<ul>
<?php 
    wp_list_bookmarks('orderby=id&title_li=&title_before=&title_after=&categorize=0');
    ?>
</ul>