ThemeShaper Forums » Thematic

Adding google tracking to functions.php

(3 posts)
  • Started 5 years ago by Jamie Mitchell
  • Latest reply from Jamie Mitchell
  • This topic is resolved
  1. Jamie Mitchell
    Member

    Howdy fellow Thematicians...

    i want to install some google tracking into the footer of a thematic child theme.

    i used this in the functions

    function below_footer(){
    ?>
    //google code goes here
    
    <?php
    }
    add_action('thematic_after', 'below_footer');

    it all works just fine...

    but i now need to install another goal tracking on one page only.

    i tried adding an is_page like this , but it did nothing. Still showing on every page.

    function below_footer(){
       if (is_page('pagenamehere')) {
    }
    ?>
    //google code goes here

    any suggestions appreciated.

    j

    Posted 5 years ago #
  2. Hi Jamie,

    tried your code without any problems:

    function below_footer(){
    if (is_page('Bilder')) {?>
    
    	Hello, this will display only on my page 'Bilder'
    
    <?php
    
    }
    
    ?>
    
    	Hello, this will display on each of my pages
    
    <?php
    }
    add_action('thematic_after', 'below_footer');

    Cheers,

    Chris

    Posted 5 years ago #
  3. Jamie Mitchell
    Member

    hey Chris...

    yeh weird, maybe because i had other stuff in the functions too it was conflicting or something. but anyway i used your code and it works a treat.

    thanks once again good teacher.

    j

    Posted 5 years ago #

RSS feed for this topic

Reply

You must log in to post.