WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: W3 Total Cache] Minify Inserting CSS/JavaScript (4 posts)

  1. Ronald Huereca
    Member
    Posted 4 years ago #

    Hello,

    I'm using template_redirect redirect action for Ajax Edit Comments. One of my users is having an issue with W3 Total Cache inserting minified JS and CSS into a custom page I have created.

    I realize this is how the plugin was designed, but am hoping there is a way to exclude certain pages.

    I've tried excluding it via the "Never Cache for the Following Pages..." but am coming up short.

    Can you please point me in the right direction?

    The code for my custom page is something like this:

    http://www.domain.com/?aec_page=comment-editor.php&action=editcomment&cid=123&pid=456&_wpnonce=728&height=525&width=620

    All the above URL should do is spit out is a normal HTML page, but in the user's case, there is conflicting CSS/JS in both the header/footer of the outputted file.

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Frederick Townes
    Member
    Posted 4 years ago #

    I would have to look at the example to make sure this advice is perfect, but your options appear to be:

    1. Don't use the default settings and instead create settings for each template directly.
    2. Manually insert the hooks into the theme with conditional statements for this case.
  3. Ronald Huereca
    Member
    Posted 4 years ago #

    Thanks Frederick, that fixed it for me.

    For others wanting to know what I did, I followed Step 1 per Frederick's instructions.

    I then added a conditional to my plugin like this:

    $queryvar = get_query_var('aec_page');
    			if (empty($queryvar))
    				return;
    
    			global $wp_query;
    			$wp_query->is_home = false;
  4. Frederick Townes
    Member
    Posted 4 years ago #

    Ok great.

Topic Closed

This topic has been closed to new replies.

About this Topic