Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1105747
    krassvs
    Participant

    Hi,

    I use sidebars extensively on a website I develop for a client. Unfortunately once the responsiveness kicks in, the sidebar is transferred to the bottom of the page, so I would like to:

    1 – Hide sidebars globally once the site hits the default mobile max size (980px, isn’t it?)
    EDIT: Solved this one myself – very easy of course. This did the trick:

    @media (max-width: 979px){
    .widget_nav_menu ul li a {
    display: none;
    }
    }

    2 – My Sidebars are “position: fixed;” through css that interferes with widget area – it works for the whole site except for one category which has too many entries. I would like to target that specific widget area which is shown in the posts for one category and tell it to be position: relative;

    An example post for this problem is: Too many entries

    3 – I tried to display category sidebars on their posts and found this thread: https://community.theme.co/forums/topic/create-sidebar-for-post-category/ … I tried all codes in the whole thread – nothing seems to work. Also I can’t find an option to specify a sidebar under ADMIN>POSTS>CATEGORY … There just is no option for that.

    Please help!

    #1105991
    Nico
    Moderator

    Hi There,

    Thanks for writing in.

    2. You can add the post id or page id class to specify it in a specific page or post only.

    3. 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
    – FTP

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

    Thanks.

    #1106033
    krassvs
    Participant

    @2 – Great answer, thanks – thinking further – all the posts belong to the same category, I got it working for single posts, but when I use Category ID it does not work … Is my code wrong?

    .category-30 .widget ul { position: relative !important; }

    EDIT: This changed the sidebar for the category view only of course … I just put in all the post IDs … works but I don’t know if it should be done like that

    #1106041
    krassvs
    Participant
    This reply has been marked as private.
    #1106571
    Rad
    Moderator

    Hi there,

    #2, Since you’re targeting specific category, then yes, you’ll have to add each category ID.

    #3, That thread is old and a lot changed since then, please try the revised code at #196190 as it works on my end. You copied the first set of code which still has some typo error.

    Thanks!

    #1107090
    krassvs
    Participant

    Hello,

    #2 I still struggle with this. My code above just changes the category overview. If I want to target all posts inside that category, I wanted to use their IDs – I just don’t know how to put it together – my code looks like this now for posts and their parent category:

    .category-30 .widget ul { position: relative !important; }
    
    .postid-1616, .postid-1426, .postid-1376, .postid-1350, .postid-1296, .postid-1173, 
    .postid-1148, .postid-1133, .postid-1102, .postid-1055, .postid-1043, .postid-1026, 
    .postid-1014, .postid-995, .postid-988, .postid-974, .postid-918, .postid-892, .postid-842, .widget ul { position: relative !important; }

    EDIT: I changed the code – it works now – please just tell me if this was the right way to do it in your opinion, thank you

    .category-30 .widget ul { position: relative !important; }
    
    .postid-1616 .widget ul,.postid-1426 .widget ul, .postid-1376 .widget ul, .postid-1350 .widget ul, .postid-1296 .widget ul, .postid-1173 .widget ul, 
    .postid-1148 .widget ul, .postid-1133 .widget ul, .postid-1102 .widget ul, .postid-1055 .widget ul, .postid-1043 .widget ul, .postid-1026 .widget ul, 
    .postid-1014 .widget ul, .postid-995 .widget ul, .postid-988 .widget ul, .postid-974 .widget ul, .postid-918 .widget ul, .postid-892 .widget ul, 
    .postid-842 .widget ul  { position: relative !important; }

    #3 I told you before – I tried all codes on the thread – so I did try that one before. But there is really no clear instruction because everything got changed so many times in the thread. Questions like these arise:
    – Do I still have to change wp-single.php (because one user said he did not)
    – Where on earth is an option to assign sidebars to categoriies – I can only find taxonomies of course in Admin>Appearance>Sidebars … but there is no option as mentioned in the thread in Admin>Posts>Categories

    Anyway I assigned the sidebars by hand – so don’t worry about it. Please help me with #2 though

    #1107805
    Rad
    Moderator

    Hi there,

    #2, Yes, that’s correct 🙂

    #3, You still need to edit wp-single.php, he probably has different customization that alters sidebar. There are many ways to do it, and you have to choose one. As I said, you need to implement the code mentioned at #196190, I checked and it isn’t.

    Thanks!

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