• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.
Resource icon

HowTo: Add XF Alerts and Conversations to WordPress

Unread and Alerts may be added to a WordPress child theme using the stored information in $visitor.

PHP:
$XF->visitor->get('alerts_unread')
$XF->visitor->get('conversations_unread')

EXAMPLE:
PHP:
echo '
<span id="member" class="loggedIn_menu_class"><a href="/community/conversations/">Inbox</a>  <strong class="itemCount">' . $XF->visitor->get('conversations_unread') . ' </strong>
<a href="/community/account/alerts">Alerts</a> <strong class="itemCount">' . $XF->visitor->get('alerts_unread') . ' </strong>
<a href="/community/logout">Log Out</a></span>
';

The CSS would look like the following:
Code:
.itemCount {
    background: none repeat scroll 0 0 #176093;
    border-radius: 3px 3px 3px 3px;
    color: #CCCCCC;
    font-size: 11px;
    font-weight: bold;
    margin-left: 5px;
    padding: 1px 7px;
    text-align: center;
}
Author
LPH
Views
492
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from LPH

Top