Excluding an Iframe Page From AO via Filter
-
Hi Frank,
I’ve run into a bit of a brick wall. We are using AO on a project to optimize CSS only, using the inline and defer CSS option. However, this breaks a page delivered via an iframe.
So, we tried to filter this iframed page from AO like so (in
functions.php
)…// add_filter('autoptimize_filter_noptimize','my_ao_noptimize',10,0); function my_ao_noptimize() { if (strpos($_SERVER['REQUEST_URI'],'iframe-url-to-skip-from-AO')!==false) { return true; } else { return false; } }
…but it’s not working: the inlined CSS just won’t go away. Moreover, when we tried a different URL to exclude (just to see if it was some sort of conflict with iframes) we ended up with the white screen of death and ultimately had to restore
functions.php
.Anyway, should this be working…?
Best,
AJ
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Excluding an Iframe Page From AO via Filter’ is closed to new replies.