function vp_unread_notifications()
{
    $count = vp_unread_notifications_count();
    $text = '';
    if ($count > 0) {
        $text .= '<span class="new-notifications">';
    }
    $text .= sprintf(_n('%d notification', '%d notifications', $count, 'v2press'), $count);
    if ($count > 0) {
        $text .= '</span>';
    }
    echo $text;
}
Beispiel #2
0
          <li class="last"><a rel="nofollow" href="<?php 
    echo vp_get_page_url_by_slug('following');
    ?>
"><?php 
    printf(__('<span>%d</span> Following', 'v2press'), vp_get_following_count());
    ?>
</a></li>
        </ul>
      </div>
    </div>
    <div class="footing">
      <p class="xsmall fade"><a href="<?php 
    echo vp_get_page_url_by_slug('notifications');
    ?>
"><?php 
    printf(_n('%d notification', '%d notifications', vp_unread_notifications_count(), 'v2press'), vp_unread_notifications_count());
    ?>
</a></p>
    </div>
    <?php 
} else {
    ?>
    <div class="heading">
      <p><strong><?php 
    bloginfo('name');
    ?>
</strong></p>
      <?php 
    if (get_bloginfo('description')) {
        ?>
      <p class="xsmall fade"><?php 
Beispiel #3
-1
/**
 * Custom the wp_title()
 *
 * @since 0.0.1
 */
function vp_title()
{
    global $page, $paged;
    $output = '';
    if (0 < vp_unread_notifications_count()) {
        $output .= '(' . vp_unread_notifications_count() . ') ';
    }
    $name = get_bloginfo('name');
    $description = get_bloginfo('description');
    $sep = ' &#155; ';
    $normal_title = wp_title($sep, false, 'left');
    $output .= $name;
    if ($description && (is_home() || is_front_page())) {
        $output .= ' - ' . $description;
    } elseif (is_page('member')) {
        $output .= $sep . esc_attr(get_query_var('member_name'));
    } else {
        $output .= $normal_title;
    }
    // Add a page number if necessary
    if ($paged >= 2 || $page >= 2) {
        $output .= $sep . __('Page', 'v2press') . max($paged, $page);
    }
    echo $output;
}