- This topic has 10 replies, 2 voices, and was last updated 6 years, 2 months ago by
Leo.
-
AuthorPosts
-
September 24, 2017 at 7:57 pm #391270
Robert
Having an issue when creating an Elementor layout under ‘my library’ where the sidebar makes the layout narrower. https://cl.ly/0F1d0Z29323v. I thought that making the sidebar option under customizer set to “content (no sidebars)” would work and it did for pages but not for this page. Then I set single post sidebar options to the same and it fixed it, however this isn’t ideal because i do want a sidebar on my single posts. So what i’m asking basically is if there is a way to not have the sidebar shown on the “my library” pages when editing in Elementor. Thanks!
September 24, 2017 at 11:20 pm #391309Leo
StaffCustomer SupportThis might help: https://docs.generatepress.com/article/sidebar-layout/#different-sidebar-layouts-for-individual-pages-and-posts
Can you link me to the page if it doesn’t? Thanks!
September 25, 2017 at 12:40 pm #391775Robert
The function looks interesting. How would I target it if the page is… /wp-admin/post.php?post=162&action=elementor?
Would I have to try to look for that in the URL?
September 25, 2017 at 12:52 pm #391778Robert
I THOUGHT I figured it out by adding the following… BUT it’s adding some weird gap on the front end even when the url does not contain ‘elementor’.
add_filter( 'generate_sidebar_layout','elementorlib' ); function elementorlib() { $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; if (false !== strpos($url,'elementor')) { return 'no-sidebar'; } }
Another question – The layout isn’t full width, like it would be if i was working on a page (this likely again has to do with the fact that it’s using a post style layout. Is it possible, using a similar function, to force a full width layout via the page builder container options?
September 25, 2017 at 4:29 pm #391876Leo
StaffCustomer SupportYou can try a conditional tag like this:
is_page( 'your-page' )
More info here: https://codex.wordpress.org/Conditional_Tags#A_PAGE_Page
September 25, 2017 at 6:39 pm #391921Robert
Well, it’s not really a specific page. When you use the Elementor editor under “my library” you’re essentially editing a post that has no specific name or differentiator so it makes it difficult to figure something like this out.
September 25, 2017 at 11:45 pm #391999Leo
StaffCustomer SupportSorry I’m confused. So what are you trying to achieve? Set all Elementor layout to no sidebars?
September 26, 2017 at 9:21 am #392318Robert
I’m trying to achieve a full width layout to operate within when editing a custom template. This isn’t the same as firing up Elementor on a page or post, this is under “my library”. When doing the former, you can easily specify ‘full width’ as the layout option, however when you’re operating in ‘my library’ and editing a pre-defined template there is no such capability to edit the page you’re currently editing as they aren’t really pages. If you click into it, it doesn’t show as a page, it just opens up Elementor immediately and uses the theme’s default settings to control how the page you’re on operates. As per one of my previous messages, I know I can set the default layout to full width in customizer but that would affect everything, so I’m looking for a programmatic way to simply adjust the ‘my template’. I’d say the easiest way for you to understand is by loading up elementor and going under ‘my templates’ and seeing what i mean.
September 26, 2017 at 11:40 am #392403Leo
StaffCustomer SupportSo you are not able to use the sidebar metabox on those pages?
What about using the template conditional tag? https://codex.wordpress.org/Conditional_Tags#Is_a_Page_Template
There needs to be some sort of logic to use function.
September 26, 2017 at 12:29 pm #392443Robert
Wow I’m an idiot. This is what happens when you stare at the same thing for days lol. You CAN edit those options and there is a page that the meta boxes exist in. I was just hitting “edit with elementor” directly and not going into the page. I feel dumb. Thanks for your help. Maybe delete this thread lol. Thanks.
September 26, 2017 at 12:39 pm #392447Leo
StaffCustomer SupportNo problem! 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.