the answer for all question about Oxygen Builder plugin and WordPress

I’ve created a Oxygen template for Pages.

I’ve created a Oxygen template for Pages.
The content area is 800px wide… which works great for some content.

But I want the content area to be 1200px wide on some pages.

I could create another template, I guess…

But how can I selectively apply templates to Pages?



Source

3 Comments
  1. Adam Baker says

    If you have multiple templates using the same areas you can set their priority (on the template page). You can also assign templates to different pages using filters and selecting Pages &+ the ID of the page.

  2. Cédric Bontems says

    On each page, in the oxygen meta box, you can choose which template to use specifically for this page.

  3. Niko Strobel says

    If the only difference is the inner content width, I don’t use two different templates but control it with a utility taxonomy.

    This is going to sound complicated but it’s totally easy and works beautifully for me.

    My use case where I need this a lot: I set up a template for Gutenberg based inner pages and give the inner template (wrapped in a div) a width, e.g. 960px, and a class “my-inner-content” (or whatever)

    I have also by default set up a custom taxonomy “utility” that allows me (i.e. the client) to control many aspects just by adding or removing terms from a specific page.

    I have also enabled taxonomy terms to show up in the body class.

    So, if I need a different width of 1200px, I would create a term “wide-width” and assign it to pages where the content needs to be wider. In the frontend, it would render with body class .tax_term-wide-width.
    All I have to do now is to write a line of CSS tatgeting .tax_term-wide-width .my-inner-content and give it a different width.

    And this works with so many other things a client might want, e.g. different background colors etc… also combinations of different terms (e.g. “wide width” + “green background” + “no header”) where you would normally need a different template for each combination.
    Plus it’s very easy to explain (and for the client to understand) how he can manipulate his content, without having to mess with Oxygen at all.

Leave A Reply

Your email address will not be published.