I'm trying to hide a chat script from appearing on my buddypress site under certain conditions. The conditions are:
1) Only level 1 members and higher can see the chat script.
2) The chat script shouldn't appear on any of my payment pages.
So, I added the code below to my themes header.php file:
- Code: Select all
<?php if(current_user_can("access_s2member_level1") OR (!is_page( array( 100, 1773, 1791, 1778, 1784 ) ) ) ) {
echo '<link type="text/css" rel="stylesheet" id="arrowchat_css" media="all" href="/arrowchat/external.php?type=css" charset="utf-8" />';
echo '<script type="text/javascript" src="/arrowchat/includes/js/jquery.js"></script>';
echo '<script type="text/javascript" src="/arrowchat/includes/js/jquery-ui.js"></script>';
}
?>
However the chat script still shows. But if I isolate the code to just one query ie, use just
current_user_can or !is_page they work fine independently, but combined together it doesn't work
What am I doing wrong?
Thanks
Rob.