Put javascript on any page, exclude a homepage? (3 posts)

  1. Zavarzin
    Posted 4 years ago #

    Hi, I want javascript to show on any page except of the homepage.
    What should I use?

    I thought excluding the homepage with <?php if(!(is_home)) { ?> it would work but it also NOT showing the script on other pages.

    How to separate this two things:

    1) show javascript on any page;
    2) not show javasctipt on a homepage?


    P.S. I installed the wordpress in a subdirectory if it matters.

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Are you enqueing the javascript correctly?.

  3. Your conditional is incorrect.

    Try this:

       if(! is_home()) {
          ... //run your script

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.