WordPress.org

Support

Support » Plugins and Hacks » OpenHook » [Resolved] What mistake did I make? Want to add code before closing body tag.

[Resolved] What mistake did I make? Want to add code before closing body tag.

  • I need to target one page only.

    The code I need to add is (I think) javascript. Since I want it before the < / body > tag, I added it to “headway_body_close”.

    I added:

    if (is_page('page-1')) {
    
    <input type="hidden" id="hidLocation" value="http://domain.com/" /> <script type="text/javascript" src="http://domain.com/landing.js">
    
    }

    But that doesn’t work. All pages show the code, and not just the one I want.

    What mistake did I make?

    Thanks,
    Lim

    http://wordpress.org/extend/plugins/thesis-openhook/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Rick Beckman

    @brazenlygeek

    <?php if (is_page('page-1')) { ?>
    
    <input type="hidden" id="hidLocation" value="http://domain.com/" /> <script type="text/javascript" src="http://domain.com/landing.js">
    
    <?php } ?>

    You need to enclose the PHP code in PHP tags. The above should work.

    Thanks, that worked!

    Plugin Author Rick Beckman

    @brazenlygeek

    No problem, friend. Thanks for using OpenHook!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] What mistake did I make? Want to add code before closing body tag.’ is closed to new replies.
Skip to toolbar