Change a page layout in php

Hi,

I set my pages layout to have the content left and the sidebar right. It’s the settings for my whole website but I only need the homepage to be set like that. When I create a new page I go on the “Preferences” page to change it to fullwidth.

The thing is that I use now the plugin WP Job Openings. When I create a new job it’s automatically with the left content and the sidebar, so it’s quite ugly.

When I inspect the code with my browser I can change it, I replace “x-main left” by “x-main full” but where can I do that in the code ?

I also tried to change the template settings to fullwidth everywhere but when I want to switch just my homepage to have the right bar it stays fullwidth.

Thank you for your help

Hello Jerome,

Thanks for writing in!

If you want to have a full width layout other than home page then first under X > Theme Options > Layout and Design > Site Layout and select Full Width.

After that to change the layout of home page to display sidebar, please follow along:

  • Open the page in Cornerstone.

  • Open the page settings by clicking on the Settings icon placed in bottom left sidebar.

  • Under Page Settings > General > Page Template select Layout - Content Left, Sidebar Right.

Let us know how it goes.

Thanks.

Hello @Prasant

Thank you for your reply.

I already tried that and just retried to be sure but the home page is still fullwidth.

Hello Jerome,

Is your homepage the same as your blog index? You might have set it to fullwidth. Please go to X > Theme Options > Blog and make sure that you select “Use Global Content Layout” for the layout settings.

Please let us know how it goes.

Hello @RueNel,

I just checked and it was already set on “Use Global Content Layout”.

Thank you

Hey Jerome,

​To assist you better with this issue, would you mind providing us the url of your site with login credentials so we can take a closer look? This is to ensure that we can provide you with a tailored answer to your situation.

To do this, you can create a secure note with the following info:
– Link to your site
– WordPress Admin username / password

To know how to create a secure note, please check this out: https://theme.co/apex/forum/t/how-to-get-support/288

Thank you.

Hello Jerome,

I have checked your settings and the global content layout has been set to Fullwidth.
X > Theme Options > Layout & Design > Content Layout will be applied to your default page templates, posts and any other custom post types.

If you want that your default page templates, posts and any other custom post types will be fullwidth, then you select “Fullwidth”. The draw back is that no page will ever have a sidebar which is what is happening now. Since you already set it to Fullwidth, the homepage cannot have any sidebar even if you have selected the Layout - Sidebar Left, Content Right or Layout - Content Left, Sidebar Right.

What is possible is that you may select the Sidebar Left, Content Right or Content Left, Sidebar Right in X > Theme Options > Layout & Design > Content Layout and your default page templates, posts and any other custom post types will have a sidebar. If you want a fullwidth page, then you can choose the Layout - Fullwidth from the page templates.

Hope this explains how the content layout works.

Yes I know, this is how I set it. The thing is, and it was my first question, when I use a plugin that creates pages they have a sidebar so I wanted to know if I can go the code and change the settings there.

Hello Jerome,

Back to your original question:
Your Job plugin generates custom post type and not pages. The job post types will follow the global content layout like the posts. With posts and custom post types, there is no template available like what we have with pages where you can change the page templates.

To override the content layout for your custom post types, you might check out this thread:

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.