Where to add code so it shows on every page?
Hello,
I am trying to add some code for a Tag Cloud. My good friend helped me by telling me to add the code to tpl_main_page.php, which I have done and it's working just fine on the main page. However, I would like this to show on every page. Which file would I need to add my code for this to be accomplished?
Here is my code:
PHP Code:
<?
/* Start TagCloud */
require_once(DIR_WS_MODULES . 'tagcloud/m1_tagcloud.php');
echo insertTagCloud(1, "DESC");
/* End TagCloud */
?>
I tried adding it to the tpl_footer.php but it only showed on the main page.
Thank you,
Re: Where to add code so it shows on every page?
In the tpl_footer.php or tpl_mainpage
these are part of every page
Re: Where to add code so it shows on every page?
Is there a specific area on these files I should place the code? I tried it on both and it only showed on the main page.
Re: Where to add code so it shows on every page?
the verry bottom ot the tpl_footer.php
Re: Where to add code so it shows on every page?
Thank you Merlin. I just removed it from tpl_main_page and added it to the very bottom of tpl_footer. When I click on a category or a product it still isn't showing on the bottom of the page. I am baffled because I thought it should be showing. That is why I tried it originally in the tpl_footer.
I may just end up leaving it alone? It is strange though.
Re: Where to add code so it shows on every page?
try changing
require_once(DIR_WS_MODULES . 'tagcloud/m1_tagcloud.php');
to
require(DIR_WS_MODULES . 'tagcloud/m1_tagcloud.php');
Re: Where to add code so it shows on every page?
The following error is received when on a product page:
Quote:
Fatal error: Cannot redeclare inserttagcloud() (previously declared in /home/swiker2/public_html/values-galore/includes/modules/tagcloud/m1_tagcloud.php:66) in /home/swiker2/public_html/values-galore/includes/modules/tagcloud/m1_tagcloud.php on line 0
no worries ... I will just be happy with them on the main page. I appreciate you going through this with me.