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.

In its current version, there is no GUI to specify the if condition that the above setting should take effect on. If time permits, I shall try to add something like this (screenshot from WooSidebars plugin) in the future.

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

return ( is_page( 'contact' ) ? true : false ); // 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!

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