Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1213096
    Nico Collu
    Participant

    I have creating custom sidebars and even thought I directly tell a Sidebar to go into a SPECIFIC blog post, it doesn’t show.

    The Post Settings is NOT fullwidth.

    What am I doing wrong?

    Website: http://www.nicocollu.com/curiosity-super-powers/

    #1213154
    Rahul
    Moderator

    Hey There,

    Thanks for writing in!

    Regretfully, at this time I am not entirely certain what it is you’re trying to do.
    If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do. We’ll be happy to provide you with a response once we have a better understanding of the situation.

    Thanks for understanding!

    #1213224
    Nico Collu
    Participant

    Hello Rahul!

    I want to include a custom Sidebar to blog posts as a start! 🙂

    #1213712
    Nico Collu
    Participant

    Alright so this is the update.

    I see that the “Content Left, Sidebar Right” is the way to go although it isn’t for me.

    First of all, the sidebar still won’t show on my post even know the sidebar has been set to show on the blog post with widgets on it. It even pushes all of my content to the left which is in itself a problem.

    I’d like for the sidebar to appear only in the content area of the blog, not to disrupt the width of the header or above or the comments and below that.

    Is this a possibility?

    #1213977
    Rad
    Moderator

    Hi there,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    You mean add sidebar to your single post or the blog page?

    Thanks!

    #1214527
    Nico Collu
    Participant
    This reply has been marked as private.
    #1214831
    Rupok
    Member

    Hi there,

    Thanks for the access. You are using “Fullwidth” content layout as I can see on your Customizer – http://prntscr.com/cte1nj

    Also you are not using a sidebar template for the blog page either – http://prntscr.com/cte1ym

    You didn’t even enable the custom sidebar for any of your blog posts – http://prntscr.com/cte2df

    So actually you did nothing yet to show the sidebar for your blog posts and that’s why it’s not there. Please do the steps and you will see that in place.

    Hope this makes sense.

    #1214901
    Nico Collu
    Participant

    Hey Rupok! I understand how you can get annoyed but let me assure you:

    I DID try the Costumizer option & the Custom Sidebar enabling to the posts.
    The Custom Sidebar is still enabled to be shown on the “Mindset” category whereas all my posts are situated which you might’ve missed. The Costumizer option I removed as it messed up the layout and wouldn’t show the sidebar at all even though the Custom Sidebar has widgets in it.

    About the Sidebar Template, I can’t seen to find that option for posts? Did you go in to check yourself?
    If so, it’s not in the same place as Pages have it.

    I understand you don’t know me, but please know that I am not some idiot writing support as soon as I find a problem without even trying out solutions I can find or read to in the support forum from other users.

    There might still be a simple solution to this but I cannot find it and that is why I am asking for help.

    Keep in mind, getting the sidebar to SHOW is the first step for me.

    The other would be to make sure it doesn’t mess up the layout and only shows AFTER the header so the single post header can stay fullwidth!

    Looking forward to hear from you again! 🙂

    #1215358
    Rad
    Moderator

    Hi there,

    The full-width setting within Layout & Design section overrides all another layout if local layout is set to inherit the global one. Though, I understand what you’re trying to achieve. Please add this code to your child theme’s functions.php

    function x_get_content_layout() {
    
        $content_layout = x_get_option( 'x_layout_content' );
    
        if ( $content_layout != 'full-width'  || is_singular( 'post' ) ) {
          if ( is_home() ) {
            $opt    = x_get_option( 'x_blog_layout' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_singular( 'post' ) ) {
            $layout = 'content-sidebar';
          } elseif ( x_is_portfolio_item() ) {
            $layout = 'full-width';
          } elseif ( x_is_portfolio() ) {
            $meta   = get_post_meta( get_the_ID(), '_x_portfolio_layout', true );
            $layout = ( $meta == 'sidebar' ) ? $content_layout : $meta;
          } elseif ( is_page_template( 'template-layout-content-sidebar.php' ) ) {
            $layout = 'content-sidebar';
          } elseif ( is_page_template( 'template-layout-sidebar-content.php' ) ) {
            $layout = 'sidebar-content';
          } elseif ( is_page_template( 'template-layout-full-width.php' ) ) {
            $layout = 'full-width';
          } elseif ( is_archive() ) {
            if ( x_is_shop() || x_is_product_category() || x_is_product_tag() ) {
              $opt    = x_get_option( 'x_woocommerce_shop_layout_content' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            } else {
              $opt    = x_get_option( 'x_archive_layout' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            }
          } elseif ( x_is_product() ) {
            $layout = 'full-width';
          } elseif ( x_is_bbpress() ) {
            $opt    = x_get_option( 'x_bbpress_layout_content' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( x_is_buddypress() ) {
            $opt    = x_get_option( 'x_buddypress_layout_content' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_404() ) {
            $layout = 'full-width';
          } else {
            $layout = $content_layout;
          }
        } else {
          $layout = $content_layout;
        }
    
        return $layout;
    
      }

    This will enforce content-sidebar layout on all blog post item overriding any customizer global setting.

    Thanks!

    #1215930
    Nico Collu
    Participant

    Hey Rad!

    This doesn’t work. I am able to achieve that solution without all that coding.
    Even so, it still doesn’t show the sidebar that I have set to show on the posts I have created so something is wrong.

    Apart from that, it should show below the entry-header which it is not doing.

    See attached image of what I am seeing on the post and proof that the custom Sidebar is set to show on the category.

    Maybe I should ask you to research why the sidebar isn’t showing, possibly to try to reflect it or get it show yourself and what styling is making the sidebar engulf the whole right side instead of under the entry-header and above the comments??

    #1216008
    Paul R
    Moderator

    Hi,

    I can see you only taxonomies but you need to tick on each posts.

    By ticking just the taxonomy your sidebar will only appear in the taxonomy page.

    eg. http://www.nicocollu.com/category/mindset/

    It’s not showing as of the moment as you have set the archives layout to full width.

    To make the taxonomy work, you can add this in your child theme’s functions.php file.

    
    add_filter( 'ups_sidebar', 'fix_category_sidebar' );
    
    function fix_category_sidebar($default_sidebar ) {
        
       
         $categories = get_the_category();
         $post_categories = array();
         if(is_array($categories)) {
         foreach ( $categories as $category ) {
              $post_categories[] = $category->term_id;
         }
         }
         
         $sidebars   = get_option( 'ups_sidebars' );
         if(is_array($sidebars)){
         foreach ( $sidebars as $id => $sidebar ) {    
                if(isset($sidebar['taxonomies']) && is_array($sidebar['taxonomies'])){         
                 foreach($sidebar['taxonomies'] as $t_id => $tax) {
                     if(in_array($t_id,$post_categories)) {
                         return $id;
                     }
                 }               
                 }           
         }
         }
        return $default_sidebar ;
    }
    

    Hope that helps.

    #1216024
    Nico Collu
    Participant

    Great Paul, it’s working now!

    Still, is it possible to get the sidebar to appear AFTER the entry-header instead of taking up the whole right side of the page?

    #1216627
    Rad
    Moderator

    Hi there,

    It’s not possible, your single posts are still full width.

    The code that I provided is not about adding the sidebar, it’s forcing the layout that enables sidebar so you could assign a sidebar. The one that you can achieve without the coding is just assigning the sidebar, but you can’t do that if your layout is set to full-width.

    Thanks!

    #1216654
    Nico Collu
    Participant

    Hey Rad!

    Are you telling me that if I remove fullwidth then I can have it so the sidebar is placed below the entry-header?
    If so, I can force the entry-header to be fullwidth via CSS and the rest will be content-sb-right?

    I’m guessing that it would require changes to the HTML structure?

    #1217060
    Rad
    Moderator

    Hi there,

    No, moving under the header is not part of provided solutions yet. What we’re suggesting is to make it work one at a time. You can’t move any sidebar when it’s not there.

    Yes, it’s easier to make non-fullwidth to go full-width (CSS) than making the full-width have a sidebar (which is only possible through PHP). And if CSS isn’t enough, then structure change is possible, maybe through javascript.

    Cheers!

  • <script> jQuery(function($){ $("#no-reply-1213096 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>