• Resolved anderskitson

    (@anderskitson)


    FIXED: All I had to do was change is_home to is_front_page

    I would like to add some basic html page to my homepage that I setup as a static page in wordpress. Well it is a little more complex I would also like to add a jquery plugin only for that page as well. How would I go about doing this, some sort of IF statement I suppose. IF home page add this code IF NOT do not add code, sounds simple but I am not sure how to achieve it. Even sending me to the right place to read about doing this would be great. Thanks!

    I know I need to use this is_home() but I am not sure where and exactly how it would look.

    I have tried to do this but nothing outputs, and I am on the homepage so I am not sure what to do. UPDATE: Turns out it was not the homepage so I am trying to fix that right now. Ok well I have the home page set to a static page called About and when I am on the home page the else statment runs, that seems backwards to me, what am I doing wrong?

    <?php
    if ( is_home() ) {
        echo "<h1>Hello</h1>";
    } else {
        // This is not a homepage
        echo "<h1>Goodbye</h1>";
    }
    ?>
  • The topic ‘Static html on a single page in wordpress’ is closed to new replies.