WordPress.org

Ready to get started?Download WordPress

Forums

Overriding W3 total Cache User Agent Group theme choice (4 posts)

  1. mcegielka
    Member
    Posted 2 years ago #

    I'm using the User Agent Groups feature of W3 Total Cache to present a mobile template to users of a certain set of devices - the automatic switching works just fine.

    However, I'd also like to be able to provide a "View full site" and "View mobile site" link to visitors, so they can switch between mobile and desktop views as they wish.

    I've tried using the 'template' filter hook, adding a filter that runs with lower priority (i.e. later) than W3 Total Cache's, but if the user's choice doesn't match what W3TC wants to show them, then WordPress appears to try and load both themes, which is obviously not a good thing when both might have identically named functions.

    Is there a way to safely and cleanly override W3TC's theme choice, or am I going to have to use another method of switching themes this way?

  2. Bob Gregor
    Member
    Posted 2 years ago #

    I'm in the same boat — looking for an elegant way to override W3 Total Cache's handling of mobile device detection.

  3. Bob Gregor
    Member
    Posted 2 years ago #

    Found one:
    Simple Theme Preview
    Although it seems to break child themes...

  4. Frederick Townes
    Member
    Posted 2 years ago #

    You can simply disable the groups.

Topic Closed

This topic has been closed to new replies.

About this Topic