Support » Fixing WordPress » php if else – trying to execute javascript

  • Resolved JaanMatti



    I’m trying to execute a wordpress conditional tag according to instructions, but I guess I’m doing something wrong. What I’m trying to do, is to display a jquery overlay on the whole page when a normal visitor visits the site. And not display the overlay, when I’m logged in.

    The overlay works nicely, but I can’t get the if/else to work. Here’s the code:

    		if ( ! is_admin() ) {
         echo '';
    } else {
         echo '<script type="text/javascript" src=""></script>
    		<script type="text/javascript" src=""></script>';

    Basically what happens is, I can change the code either way, and it always only either displays the overlay in both cases (logged in and not), or never displays it (logged in or not). Can someone point out what I’m missing here?


Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘php if else – trying to execute javascript’ is closed to new replies.