Thanks so much for your continued help with this.
I added the code to the child theme’s function.php, but it broke Cornerstone (X theme’s front end page builder). When I removed the code, Cornerstone recovered.
Any idea what could be going on there?
-
This reply was modified 9 years, 11 months ago by
outpost33.
hmmm .. weird.
try this;
* create a new file
* put this in it;
<?php
/*
Plugin Name: Outpost Noptimize
Plugin URI: http://andrewcohen.com/
Description: Stop autoptimize on download page
Author: outpost33
Version: 0.1
Author URI: http://andrewcohen.com/
*/
add_filter('autoptimize_filter_noptimize','outpost_noptimize',10,0);
function outpost_noptimize() {
if (strpos($_SERVER['REQUEST_URI'],'awakening-authentic-self-disc-01/')!==false) {
return true;
} else {
return false;
}
}
* save as “outpost_noptimize.php”
* put it in wp-content/plugins
* go to plugins and activate “Outpost Noptimize”
hope this does work (it should).
frank
Interesting.
When the noptimize plugin I created is activated, and Optimize Javascript is ticked, it still breaks Cornerstone.
well, the only goal of the noptimize-plugin is not to optimize on your download page. cornerstone (being a page builder, heavily relying on JS) will need some more TLC, as in changing this line of code;
if (strpos($_SERVER['REQUEST_URI'],'awakening-authentic-self-disc-01/')!==false) {
into
if (strpos($_SERVER['REQUEST_URI'],'awakening-authentic-self-disc-01/')!==false || is_user_logged_in()) {
this disables AO on the download page OR if you’re logged in (which is one way to identify when you might be needing a page builder).
frank
Hi Frank,
Thanks for your continued help with this issue. I’m trying to temporarily deactivate the plugin so I can diagnose another issue with Events Manager, but Autoptimize refuses to deactivate. WordPress gives me the deactivation message, but the plugin remains active.
Ignore previous message – plugin is deactivating fine now.
Cheers!
🙂
you can stop AO on a per-request basis by adding ?ao_noptimize=1 to the URL. might be more handy 😉