I have a script on a buddypress set up which shows a user on the 'members area' if they have a notification, it just prints "You have new notifications (22)" or "You do not have any notifications".
Typical set up, I am a little lost on how to correctly print a link that is not going to change..
Currently the code for when they have a notification is;
if ( $instance['show_count_in_title'] ) {
printf( "<span class='notification-count-in-title'>(%d)</span>", $count );
}
However when I add in the link to the text, it breaks, I have tried within the span and outside, but always in the (".. I am not totally clued up on PHP so maybe I am wrong to use links in this way? But I guess more so I am confused to why
When I do this;
if ( $instance['show_count_in_title'] ) {
printf( "<a href="me/notifications"><span class='notification-count-in-title'>(%d)</span></a>", $count );
}
I get the following error:
Parse error: syntax error, unexpected 'http' (T_STRING) in /homepages/2/d676463482/htdocs/dc/wp-content/plugins/buddypress-notifications-widget/core/class-bp-notification-widget.php on line 59
I presume I am entering the a href incorrectly for PHP but I have struggle to figure out what it should be.