ThemeShaper Forums » Thematic

[closed]

Conditionally add stuff

(2 posts)
  • Started 4 years ago by Seijun
  • Latest reply from Chris
  • This topic is not resolved
  1. Say I have this added to my functions.php

    function my_code() {?>
    
    <script type="text/javascript">
    random js scripss
    </script>
    
    <?php }
    add_action('wp_footer','may_code');

    How do I tell this to NOT appear for pages?

    Posted 4 years ago #
  2. Hi,

    this would be something like:

    function my_code() {
        if (!ispage()) {?>
    
    <script type="text/javascript">
    random js scripss
    </script>
    
    <?php
        }
    }
    add_action('wp_footer','may_code');

    More details 'bout conditional tags: http://codex.wordpress.org/Conditional_Tags

    Chris

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.