Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #157259

    markserranopro
    Participant

    I have the Ethos stack and I want to add a sidebar just to blog posts theme but I’m having trouble because the masonry view wont let me do it without having sidebars on the index page and archive pages. I just want a sidebar only on the posts. How do I do that? There isn’t any options and I’m not finding any help about it with the child themes.

    I’ve added my own CSS to this page to show an example of what I’m looking for. I can’t have a real sidebar because I can’t add divs from the CSS panel.
    http://hankami.com/2014/12/litostarr-new-mixtape-sagittarius/

    #157382

    Paul R
    Moderator

    Hi,

    Thanks for writing in!

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    After setting up a child theme, create file wp-single.php in wp-content\themes\x-child-ethos\framework\views\ethos
    and copy the code below into that file.

    
    <?php
    
    // =============================================================================
    // VIEWS/ETHOS/WP-SINGLE.PHP
    // -----------------------------------------------------------------------------
    // Single post output for Ethos.
    // =============================================================================
    
    $fullwidth = get_post_meta( get_the_ID(), '_x_post_layout', true );
    
    ?>
    
    <?php get_header(); ?>
      
      <div class="x-container-fluid max width main">
        <div class="offset cf">
          <div class="x-main left" role="main">
    
            <?php while ( have_posts() ) : the_post(); ?>
              <?php x_get_view( 'ethos', 'content', get_post_format() ); ?>
              <?php x_get_view( 'global', '_comments-template' ); ?>
            <?php endwhile; ?>
    
          </div>
    
          
            <?php get_sidebar(); ?>
         
    
        </div>
      </div>
    
    <?php get_footer(); ?>
    

    Hope that helps. πŸ™‚

    #198434

    Water4You
    Participant

    Hi, I did this very thing for the Integrity theme (changing the code to reflect such) and I see no way of having a sidebar that operates on posts only. What am I missing? Does the code need to reflect Integrity-light? πŸ™‚

    Site: http://obministries.wpengine.com

    Thanks

    #198439

    Water4You
    Participant

    This apparently also broke the SumoMe highlighter, it only works sometimes.

    #198740

    Christopher
    Moderator

    Hi there,

    Please ignore above code and add the following CSS under Customize -> Custom -> CSS :

    .blog .x-sidebar {
    display: none;
    }
    .blog .x-main {
    width: 100%;
    }

    Hope it helps.

    #199109

    Water4You
    Participant

    Ha ha, this code made the sidebar on main landing page disappear. πŸ™‚ I removed it. What I want to do is to be able to display a sidebar that is different from the one on the landing page and only displays on posts, no pages. Is this possible?

    Thanks for replying.

    #199403

    Christian
    Moderator

    Hey there,

    That is possible. Please see https://theme.co/x/member/kb/unlimited-sidebars/ to learn how to setup different sidebars. Your Content Layout must be set to Content Left, Sidebar Right or Sidebar Left, Content Right and your Blog Layout must be set to Use Global Content Layout. For your pages not to have a sidebar, you must choose a page template that has no sidebar. The default page template will have a sidebar in this case because it’ll get the setting of the Content Layout.

    Hope that helps. πŸ™‚

    #200158

    Water4You
    Participant

    OK thank you, will see what I can do. πŸ™‚

    #200480

    Darshana
    Moderator

    Let us know how it goes πŸ™‚

    #329126

    archonic
    Participant

    Selecting a no sidebar default template should still allow you to select a sidebar template for specific pages. It’s unconventional to require custom templates for such a common setup, and confusing to allow such a setup with no explanation as to why the sidebar doesn’t show when a sidebar containing template is selected for a specific page.

    #329291

    Lely
    Moderator

    Hello There,

    We have to choose Content Layout with sidebar on the Global settings so we can use a page template with sidebar. And then you can still set other page layout template to be fullwidth in case you don’t want to show the sidebar on specific pages. On pages template we can also select an opposite sidebar. On other hand, selecting fullwidth on the global settings then Content Layout with sidebar on the template page won’t work. I will raise you’re issue with this to our developers.

    Hope this helps.

    #699313

    dlist
    Participant

    Hi there. Is there any progress in providing us with a solution that will be displaying a sidebar just on posts and not the archive or home page? As said before it seems to be a basic requirement for a magazine-style template.
    Cheers

    #699586

    Rupok
    Member

    Hi @dlist

    We certainly appreciate the feedback! This is something we can add to our list of feature requests. This way it can be taken into consideration for future development. All of these items are discussed with our team internally and prioritized based on the amount of interest a particular feature might receive. Thanks!

    #772221

    VisionMule
    Participant

    I have to say, it doesn’t make a lot of sense to put only one defining option on the Blog settings in the Customizer (which is what happens when you choose Full Width under Layout and Design).

    The Blog NEEDS to have the “Sidebar Left, Content Right” and “Content Left, Sidebar Right” options just like the Layout and Design Customizer options have (which equates to the Global Content Layout setting).

    Many sites these days do not have a sidebar for the overall layout. So having “Use Global Content Layout” and “Full Width” as your only Blog options is superfluous.

    Please bump this on your feature requests!

    Thanks!

    #772735

    Rue Nel
    Moderator

    Hey @visionmule,

    Thanks for the feedback! Yes we have forwarded this thread to our developers and will be taken into considerations for future enhancements of the theme. Please bear with us.

    Best Regards.