[Plugin: WP Super Cache] How to Dynamically Load This Script
-
Hi There,
I am totally confused on how to dynamically load the following PHP Script:
First, you have this code which has been placed into functions.php:
$ref = $_SERVER['HTTP_REFERER']; $SE = array('/search?', 'images.google.', 'google.', 'bing.', 'web.info.com', 'search.', 'del.icio.us/search', 'soso.com', '/search/', '.yahoo.'); foreach ($SE as $source) { if (strpos($ref,$source)!==false) { setcookie("sevisitor", 1, time()+3600, "/", ".clubpenguincheatz.com"); $sevisitor=true; } } function wpbeginner_from_searchengine(){ global $sevisitor; if ($sevisitor==true || $_COOKIE["sevisitor"]==1) { return true; } return false; }
Then, you insert this code where you’d like to display advertisements to search engine visitors:
<?php if (function_exists('wpbeginner_from_searchengine')) { if (wpbeginner_from_searchengine()) { ?> GOOGLE ADVERTISEMENT HERE <?php } } ?>
The Problem? I have WP Super Cache and have tried to follow Donncha’s Guide on how to load dynamic content, but once I do something like:
<!--mclude file.php--> <?php include_once( ABSPATH . 'file.php' ); ?> <!--/mclude-->
Which includes the codes above, everything on my website stops working except everything above this line.
What’s the best approach to do what I am needing to do?
My Goal: Show Google Ads based on whether or not you’re a Search Engine Visitor WITH WP Super Cache.
Thank You.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: WP Super Cache] How to Dynamically Load This Script’ is closed to new replies.