Inserting Specific Code on Homepage and Specific Pages

Community Forums Forums Design Tips and Tricks Inserting Specific Code on Homepage and Specific Pages

This topic is: resolved

This topic contains 14 replies, has 2 voices, and was last updated by  Anita 1 year, 7 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #7371

    amosbenharav@gmail.com
    Participant
    Post count: 1

    Hi,

    Perhaps someone can help me.

    I am using piwik opensource tracking and a heatmap plugin that goes with it.  In order for the heatmap to work, I generate page specific code.  Meaning, I need to generate specific html code for the homepage in order for it to track the homepage clicks correctly, and for each page I want to track the clicks, it needs to have its own specific code.

    Thus I cannot simply add the code to the footer in genesis simple hooks (I think) because the code is unique to pages.

    I would like to insert specific code at the end of my homepage before the tag closes for some specific pages, each with its unique code. I don’t think i can use the genesis simple hooks though because there is specific cod e I would like to use for each page, including the homepage – so its different for every page. Can you let me know how to do this?

    #7379

    Anita
    Participant
    Post count: 7409

    What theme are you using? Can you share a link to you site so we can take a look?


    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me! | Plus Me!
    When asking for help, please provide a link or screen shot showing your problem!

    #7381

    amosbenharav@gmail.com
    Participant
    Post count: 1

    Hi,

    I’m using agentpress

    I would like to add the following code to the homepage:

    <script type=”text/javascript” src=”http://www.xforextrade.com/piwik/plugins/ClickHeat/libs/js/clickheat.js”></script><noscript><p><a href=”http://www.labsmedia.com/clickheat/index.html”>Navigational analysis</a></p></noscript><script type=”text/javascript”><!–
    clickHeatSite = 1;clickHeatGroup = ‘homepage’;clickHeatServer = ‘http://www.xforextrade.com/piwik/plugins/ClickHeat/libs/click.php’;initClickHeat(); //–>
    </script>

     

    And I would like to add the following code to this page:  http://www.xforextrade.com/binary-options-brokers/
    <script type=”text/javascript” src=”http://www.xforextrade.com/piwik/plugins/ClickHeat/libs/js/clickheat.js”></script><noscript><p><a href=”http://www.labsmedia.com/clickheat/index.html”>Landing page optimization</a></p></noscript><script type=”text/javascript”><!–
    clickHeatSite = 1;clickHeatGroup = ‘binaryoptionsbrokers’;clickHeatServer = ‘http://www.xforextrade.com/piwik/plugins/ClickHeat/libs/click.php’;initClickHeat(); //–>
    </script>

     

    #7383

    amosbenharav@gmail.com
    Participant
    Post count: 1

    Hi,

    I am using agentpress

    I would like to add the following code to my homepage:  http://www.xforextrade.com

    <script type=”text/javascript” src=”http://www.xforextrade.com/piwik/plugins/ClickHeat/libs/js/clickheat.js”></script><noscript><p><a href=”http://www.labsmedia.com/index.html”>Traffic monetization</a></p></noscript><script type=”text/javascript”><!–
    clickHeatSite = 1;clickHeatGroup = ‘homepage’;clickHeatServer = ‘http://www.xforextrade.com/piwik/plugins/ClickHeat/libs/click.php’;initClickHeat(); //–>
    </script>

     

    And I would like to add the following code to this page:  http://www.xforextrade.com/binary-options-brokers

    <script type=”text/javascript” src=”http://www.xforextrade.com/piwik/plugins/ClickHeat/libs/js/clickheat.js”></script><noscript><p><a href=”http://www.labsmedia.com/clickheat/index.html”>Landing page optimization</a></p></noscript><script type=”text/javascript”><!–
    clickHeatSite = 1;clickHeatGroup = ‘binaryoptionsbrokers’;clickHeatServer = ‘http://www.xforextrade.com/piwik/plugins/ClickHeat/libs/click.php’;initClickHeat(); //–>
    </script>

    #7384

    amosbenharav@gmail.com
    Participant
    Post count: 1

    Hi

    I am using agentpress

    I would like to add code to my homepage: http://www.xforextrade.com

    and also this page:  http://www.xforextrade.com/binary-options-brokers

    #7385

    amosbenharav@gmail.com
    Participant
    Post count: 1

    this forum is acting strange, it won’t let me post a response…this is a test

    #7386

    Anita
    Participant
    Post count: 7409

    That happened to me last night. I see the message about the forum acting strange. I think it’s when you try to add a link.


    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me! | Plus Me!
    When asking for help, please provide a link or screen shot showing your problem!

    #7387

    amosbenharav@gmail.com
    Participant
    Post count: 1

    ok that’s strange that it allowed me to post…

    anyways : I am using agentpress theme

    i would like to put specific tracking code before the closing tag on the homepage: http://www.xforextrade.com
    I would like to put specific trackign code before the closing body tag on this specific page for example: http://www.xforextrade.com/binary-options-brokers

    #7388

    amosbenharav@gmail.com
    Participant
    Post count: 1

    yeah…it wont let me post the links….

    ill try like this

    the theme is agentpress

    i would like to add specific code to
    the website is www . xforextrade . com

    i would like to add specific code to this particular page: www . xforextrade .com /binary-options-brokers

    (remove the spaces)

    #7389

    amosbenharav@gmail.com
    Participant
    Post count: 1

    yeah…it wont let me post the links….

    ill try like this

    the theme is agentpress

    i would like to add specific code to the homepage
    the website is wwwxforextradecom

    i would like to add specific code to this particular page wwwxforextradecom/binary-options-brokers

    (add the dots after www and before com)

    #7390

    amosbenharav@gmail.com
    Participant
    Post count: 1

    okay that worked – it looks liek you cant post links here in this forum…

    it also means i can’t insert my code either – but its in javascript

    #7392

    Anita
    Participant
    Post count: 7409

    This is a bit more technical than my skill level, but if it’s something you need to place in the head or footer of the theme itself – you can use the box on the Genesis tab – scroll down and you’ll see Genesis Header & Footer Scripts – you can place your scripts in there.


    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me! | Plus Me!
    When asking for help, please provide a link or screen shot showing your problem!

    #7393

    amosbenharav@gmail.com
    Participant
    Post count: 1

    hmm no that won’t work here because its not for the footer of all pages its just for specific pages.

    does anyone know how to use simple hooks for this problem?

    #7410

    amosbenharav@gmail.com
    Participant
    Post count: 1

    Hi Everyone,

    I figured out how to do this with Nick’s help and I just wanted to post my response here. If you want to do this, you can do it easily through the genesis simple hooks as opposed to modifying any code in functions.php – benefit of this is that if you make a mistake your entire site won’t crash.

    Anyways if you want to include info for a particular page or a homepage you can use the following

    <?php
    if(is_page()) { ?>
    Hello World
    <?php }
    ?>

    Instead of Hello World you can place any code you want here. Place this code in in one of the boxes in genesis simple hooks (where you want it to go)

    If you are looking to add something to all pages except for homepage than you would an an ! so the code would look like:

    if(!is_home()) { ?>
    Hello World
    <?php }

    If you want to add code to a specific page then you must use is_page() instead of the is_home()
    within the brackets you can place several things including page ID, post title or nothing to make it happen for all pages.

    I hope this helps! I’m sorry I can’t put the link here in this to Nick’s page for the credit or else this message will not post – there is some problem with the forum right now.

    #7414

    Anita
    Participant
    Post count: 7409

    Thank you for sharing and glad you were able to get an answer.


    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me! | Plus Me!
    When asking for help, please provide a link or screen shot showing your problem!

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.