Hi
I added a function to my child theme which is a modified version of this: http://codex.wordpress.org/Function_Reference/is_user_logged_in
It adds a welcome message, avatar and various links to subscribers but a different view for non-subscribers. This works well and adds the message just below the page title of pages and posts. I have noticed though that its also adding this message to the RSS feed which breaks it and also to certain widgets (ones which show random posts or featured images).
I am trying to figure out a way to remove it from widgets and the rss feed and just wondering if anyone has any ideas.
Thanks
add_action( 'loop_start', 'personal_message_when_logged_in' );
function personal_message_when_logged_in() {
if ( is_user_logged_in() ) :
global $current_user;
get_currentuserinfo();
$current_user = wp_get_current_user();
echo '<div class=welcome-mess><p style="text-align: center;">'; echo get_wp_user_avatar($current_user->ID, 96); echo 'Member: ' .'<strong>' . $current_user->user_login . '</strong>'. "<br>"; echo '<a href="https://www.dugswelcome.com/members/">News</a> | <a href="https://www.dugswelcome.com/your-dugs-profile/">Profile</a> | <a href="https://www.dugswelcome.com/postcodesearch/">Search</a> | <a href="https://www.dugswelcome.com/discount-codes/">Discounts</a> | <a href="https://www.dugswelcome.com/dogfriendly/dog-friendly-maps/">Maps</a> | <a href="https://www.dugswelcome.com/printable-pdf-guides/">Downloads</a> | <a href="https://www.dugswelcome.com/bookmarks/">Bookmarks</a></p><hr /></div>';
else :
echo '<div class=welcome-nonmembers><p style="text-align: right;"><a href="https://www.dugswelcome.com/dug-shop/">Online Shop</a> | <a href="https://www.dugswelcome.com/dugs-account-sign-up/">Membership</a> | <a href="https://www.dugswelcome.com/wp-login.php?action=lostpassword" rel="nofollow">Lost Password?</a></p><hr /></div>';
endif;
}