How can I not execute some <script> </script> if the user is an administrator or any specific role?
Basically I need to do something like this:
<?php if( !User( 'Administrator', 'Editor' ) ) { <script> </script> } ?> Solution, using and statement '&&' for another specific role.
Closing <?php if() : ?>, <?php else : ?> Tag with a Column : to be able to post scripts inside the Loop.
<?php global $current_user; // Use global get_currentuserinfo(); // Make sure global is set, if not set it. if ( ! user_can( $current_user, "administrator") && ! user_can( $current_user, "specific_role" ) ) : ?> // Check user object has not got subscriber role <!-- Not Administrator --> <?php else : ?> <!-- Administrator --> <?php endif; ?>
<script> taginside<?php ?>(php tag)!! Before using<script>you need to close php tag first like this?> <script> </script> <?php.