WordPress.org

Forums

Customizr
[resolved] How to add a second sidebar on the right side (13 posts)

  1. portuga_daniel
    Member
    Posted 2 years ago #

    Hi

    I want to add a second sidebar on the right side of the page. My goal is to have two widgets areas on the same side.
    I know how to create a widget area but i don't know how to place it side by side with the right sidebar.

    Is this possible?

  2. ewsngr
    Member
    Posted 2 years ago #

    i am having similar issues with mine after i updated my woocommerce and run some updates.. my product categories went missing. i want a short code to fix it for me...

    if there is any short code to fix it please share it with me..

    When i drag a widget to my sidebar it doesn't reflect on my homepage where it's suppose to be. my left sidebar does not show any widget i add to it.

    i will love anyone to help me with solution....

  3. d4z_c0nf
    Member
    Posted 2 years ago #

    @portuga_daniel
    You mean something like a layout with 2 sidebars but instead of left and right, two right sidebars?

  4. portuga_daniel
    Member
    Posted 2 years ago #

    @d4z_c0nf
    That's it. Is that possible?

  5. portuga_daniel
    Member
    Posted 2 years ago #

    @ewsngr
    You have to enable the two sidebar layout in the theme settings.

  6. d4z_c0nf
    Member
    Posted 2 years ago #

    Mmm what if you use left and right sidebar and tell the left sidebar to stay on the right, adding this to your custom css (or your child theme style.css)

    .left.tc-sidebar {
    float: right;
    }

    Of course then you have to make other adjustments to your css, e.g. removing the left margin to the article container.. and so on

  7. d4z_c0nf
    Member
    Posted 2 years ago #

    Alternatively you can add this snippet to your child theme functions.php, still in the aim to use the left sidebar as a second right sidebar:

    add_action('wp_head', 'two_right_sidebars');
    function two_right_sidebars(){
        remove_action('__before_article_container', array(TC_sidebar::$instance, 'tc_sidebar_display'));
        add_action('__after_article_container', 'my_second_right');
        function my_second_right(){
            add_filter('tc_sidebar_position', function() {return 'left';} );
            TC_sidebar::$instance -> tc_sidebar_display() ;
        }
    }
  8. portuga_daniel
    Member
    Posted 2 years ago #

    @d4z_c0nf
    That function worked really good. That was exactly what I wanted. Thanks a lot!
    I think this should be included in the snippets.

  9. d4z_c0nf
    Member
    Posted 2 years ago #

    Mm, don't know, I think that the solution involving just that css rule was more pragmatic.. :D

  10. portuga_daniel
    Member
    Posted 2 years ago #

    That css did not worked in my case.

  11. d4z_c0nf
    Member
    Posted 2 years ago #

    Just tried again and it works to me.
    Where did you put it?

  12. portuga_daniel
    Member
    Posted 2 years ago #

    I tried the css again and it worked. The conflict was with the width that I set for the main wrapper. So, the two solutions work and yes, the css is far more simple for the people that are not familiarized with programing.

  13. d4z_c0nf
    Member
    Posted 2 years ago #

    :)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic