[Resolved] Elementor library and sidebar

Home Forums Support [Resolved] Elementor library and sidebar

Home Forums Support Elementor library and sidebar

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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!

    #391309
    Leo
    Staff
    Customer Support
    #391775
    Robert

    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?

    #391778
    Robert

    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?

    #391876
    Leo
    Staff
    Customer Support

    You can try a conditional tag like this:
    is_page( 'your-page' )

    More info here: https://codex.wordpress.org/Conditional_Tags#A_PAGE_Page

    #391921
    Robert

    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.

    #391999
    Leo
    Staff
    Customer Support

    Sorry I’m confused. So what are you trying to achieve? Set all Elementor layout to no sidebars?

    #392318
    Robert

    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.

    #392403
    Leo
    Staff
    Customer Support

    So 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.

    #392443
    Robert

    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.

    #392447
    Leo
    Staff
    Customer Support

    No problem! 🙂

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.