I have put together a plugin called Oxygen Theme Enabler for users of Oxygen to enable them to use the active theme on select pages of their WordPress site.

The plugin adds a new setting page which can be accessed at Oxygen > Theme Enabler.

Here, you can select whether you want to use the theme or Oxygen for most of your site’s pages.

You will need to edit the following line in plugin.php file of the plugin and enter your if conditional:

return is_page( 'contact' ); // enter your if condition here. Reference: https://codex.wordpress.org/Conditional_Tags

Replace is_page( 'contact' ) with the conditional depending on where you want to use the theme/Oxygen.

A few valid examples:

is_page( array( 42, 'about-me', 'About Me And Joe' ) )

is_front_page()

is_woocommerce()

and more can be seen here.

To download and install the plugin, head over to the plugin’s page on Github.

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE

Comments

For adding code blocks wrap the code in three backticks. Markdown should work.
Provide a URL of your site/webpage if something is not working.
  • Hey Sridhar,

    Just letting you know, when enabling this plugin on the latest version of Oxygen (2.1.2), it actually breaks the Oxygen editor. I’ve tried it on multiple browsers, each time I enable, it breaks, but everything works as it should after disabling this plugin.

    Thanks for sharing though!

        • I just tested in 2.2 and the core functionality works fine (Oxygen can be set to apply to only certain pages and everything else is rendered with the theme) … but I do have a small issue with the being stripped out (which I’m going to post about above)

  • Hi Sridhar!

    I am trying to display Oxygen on ALL pages EXCEPT any pages associated with ProjectHuddle which means EXCLUDING Oxygen on any urls containing path “index.php/mockup/” or “index.php/website/“. A typical ProjectHuddle url could look like “index.php/mockup/o0h1s6/”.

    The Oxygen Theme Enabler setting is set to:

    “Use Oxygen for most pages but use theme on the select views defined by the condition(s) in plugin file”

    I have tried the following but NONE have worked:

    is_page( array( ‘mockup’, ‘website’ ) ) ? true : false );

    is_page( array( ‘/mockup/’, ‘/website/’ ) ) ? true : false );

    is_page( array( ‘index.php/mockup/’, ‘index.php/website/’ ) ) ? true : false );

    is_page( array( ‘index.php/mockup/‘, ‘index.php/website/‘ ) ) ? true : false );

    Is my syntax wrong? How could I accomplish this?

    Another note:

    When the setting is

    “Use theme for most pages but use Oxygen on the select views defined by the condition(s) in plugin file”

    AND

    return ( ( is_front_page() ) ? true : false );

    It works in reverse. The problem with this is that it requires a new exclusion in plugin.php every time a new page is created.

    Thank you for any guidance you can provide!!

  • I’ve been looking for something like this and it’s working great, thank you!

    The only issue I’m having is that when it’s configured to only render Oxygen on specified pages, it strips the very first few lines of HTML including the from the pages that aren’t displayed with Oxygen (disabling the Oxygen plugin brings those lines of code back) … the lines removed are the first 6: , , , , , and .

    Any idea how to make sure these are retained?

    Thank you for your effort here!

  • While I could get this to work on single pages, is there any way to get this to work with templates?

    Example:
    ?ct_template=main&ct_builder=true

    Thanks so much again!

  • Hello Sridhar. Thanks for this great tutorial but unfortunately this does not work anymore for the newest version of Oxygen. When I enable this as you instructed in the video, the page that I want to render with a theme does not load the css of the theme at all. Any suggestions on how to solve this?

    • Hi Dario,

      There has been a relevant code change in v2.2.1 of Oxygen around Mar 2019.

      This explains why it hasn’t been working for some when the theme has been set to be used on most pages.

      I came up with a fix to my plugin but need a site or two to test.

      If you don’t mind, can you send me the WP login via the site’s contact form so I can test the fix?

  • Hi Sridhar, I’ve tried this on a couple of sites and I’m not sure it’s working with the latest version of Oyxgen. Can you check and let us know please.

  • magnifiercross
    >
    linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
    %d bloggers like this: