Oxygen Theme Enabler plugin

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.

Warning: The plugin is provided as-is, without any support.


Posted

in

, ,

by

Comments

26 responses to “Oxygen Theme Enabler plugin”

  1. APB Avatar
    APB

    Cool. Thank you!

  2. Dan Avatar

    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!

    1. Sridhar Katakam Avatar

      Just tested with WP 5.0.3 and Oxygen 2.1.2.

      When I activate the plugin everything works fine.

      Do you still have the issue? If so, what is the version of your WP?

      1. Peter Kulcsár Avatar
        Peter Kulcsár

        Is this working with the new 2.2 version?

        1. Ben Avatar
          Ben

          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)

  3. Craig Avatar
    Craig

    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!!

    1. Craig Avatar
      Craig

      Can anyone help?

    2. Sridhar Katakam Avatar

      Hi Craig,

      any urls containing path “index.php/mockup/” or “index.php/website/“. A typical ProjectHuddle url could look like “index.php/mockup/o0h1s6/”.

      Can you give me the URL of one such live page?

        1. John Anderson Avatar

          Is it fair to say that you would need to enter the page slug or post_id for this to work? not a folder/archive/ name?

          Just a thought.

  4. Ben Avatar
    Ben

    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!

  5. […] searches, ask in forums, consult others, do trial and errors, fail and re-try. One example is my Oxygen Theme Enabler […]

  6. Luigi Nica Avatar

    It’s exactly what I was looking for but I just try it now and it break my site. How can I get in touch with you?

    1. Sridhar Katakam Avatar

      Replied to your email.

  7. Daniel Avatar
    Daniel

    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!

    1. Sridhar Katakam Avatar

      That’s a backend URL.

      This plugin only affects the frontend.

    2. Sridhar Katakam Avatar

      This has been fixed in v1.0.2.

  8. Dario Avatar
    Dario

    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?

    1. Sridhar Katakam Avatar

      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?

    2. Sridhar Katakam Avatar

      Should be fixed in v1.0.2.

  9. Mark Avatar
    Mark

    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.

    1. Sridhar Katakam Avatar

      I have recently tested this with Oxygen 3.0.1 and it worked fine with the default twentynineteen theme.

      Can you share a screenshot of active plugins of one of the problematic sites?

    2. Sridhar Katakam Avatar

      I have updated the plugin in your site.

      It works now.

  10. […] an Oxygen Theme Enabler plugin made by Sridhar (who noticed this flaw). What a freaken hero! It allows you to re-enable […]

  11. […] and activate Oxygen and Oxygen Theme Enabler on the live […]

Leave a Reply to Peter Kulcsár Cancel reply

Your email address will not be published. Required fields are marked *