Per wrote:
All my previews in the Editor now trigger Statcounter. The only way I've been able to avoid this has been to temporarily disable the Statcounter code while I do a lot of editing of a particular page. Anyone out there who knows of a better way?
What I do is using php includes. I put the counter code in the footer and create a 'footer.php' that is included with this bit of code:
<div id="footer"><?php
include("inc/footer.php");
?></div>
Of course the page which has the footer included also has to have the extension php.
When editing the page, I open it locally, and it will open without the included files. Php is a server language, so a page has to be uploaded for the footer (and any other included files, like header, navbar etc) to display. So, only when testing online the counter will count, but not locally.
And normal visitors to the site will not see if anything is included or not, all they see is the entire page. (When I say 'normal' visitors I don't mean those who are using the Ffx Web developer ad-on or similar.)