Community Forums › Forums › Archived Forums › Design Tips and Tricks › Inserting Specific Code on Homepage and Specific Pages
- This topic has 14 replies, 2 voices, and was last updated 11 years, 3 months ago by Anita.
-
AuthorPosts
-
December 25, 2012 at 10:15 am #7371[email protected]Member
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?
December 25, 2012 at 11:57 am #7379AnitaKeymasterWhat theme are you using? Can you share a link to you site so we can take a look?
Love coffee, chocolate and my Bella!
December 25, 2012 at 12:06 pm #7381[email protected]MemberHi,
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>December 25, 2012 at 12:08 pm #7383[email protected]MemberHi,
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>December 25, 2012 at 12:12 pm #7384[email protected]MemberHi
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
December 25, 2012 at 12:16 pm #7385[email protected]Memberthis forum is acting strange, it won't let me post a response...this is a test
December 25, 2012 at 12:17 pm #7386AnitaKeymasterThat 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.
Love coffee, chocolate and my Bella!
December 25, 2012 at 12:18 pm #7387[email protected]Memberok 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-brokersDecember 25, 2012 at 12:20 pm #7388[email protected]Memberyeah...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 . comi would like to add specific code to this particular page: www . xforextrade .com /binary-options-brokers
(remove the spaces)
December 25, 2012 at 12:21 pm #7389[email protected]Memberyeah...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 wwwxforextradecomi would like to add specific code to this particular page wwwxforextradecom/binary-options-brokers
(add the dots after www and before com)
December 25, 2012 at 12:24 pm #7390[email protected]Memberokay 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
December 25, 2012 at 12:30 pm #7392AnitaKeymasterThis 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.
Love coffee, chocolate and my Bella!
December 25, 2012 at 12:34 pm #7393[email protected]Memberhmm 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?
December 25, 2012 at 4:57 pm #7410[email protected]MemberHi 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.
December 25, 2012 at 5:25 pm #7414AnitaKeymasterThank you for sharing and glad you were able to get an answer.
Love coffee, chocolate and my Bella!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.