ThemeShaper Forums » Thematic

How To Filter in Functions.php

(3 posts)
  • Started 3 years ago by kevinhumphrey
  • Latest reply from kevinhumphrey
  • This topic is resolved
  1. Sorry if this question has already been answered, but my search foo is weak this evening.

    I've added a leader board to my child theme via functions.php...

    // Add leader board
    function childtheme_leaderboard() {
    ?>
    <div id="leader">Leader board content</div>
    <?php
    }
    add_action('thematic_belowheader','childtheme_leaderboard');

    I only want this leader board to appear on my home page (static). What code do I need to add to filter this function?

    Thanks, folks.

    Kevin

    Posted 3 years ago #
  2. Hey Kevin,

    use this one:

    // Add leader board
    function childtheme_leaderboard() {
      if (is_home() || is_front_page()) { ?>
          <div id="leader">Leader board content</div>
    <?php
      }
    }
    add_action('thematic_belowheader','childtheme_leaderboard');

    Cheers,

    Chris

    Posted 3 years ago #
  3. Awesome! Thanks, Chris.

    Posted 3 years ago #

RSS feed for this topic

Reply

You must log in to post.