follow up question to below question about putting sidebar on top on mobile view

  • Author
    Posts
  • #152201

    maranathavc
    Member

    hi again.

    last time you helped me with css that will make sidebar come up on top of main page on mobile view.
    i have another question on this.

    how do i make sidebar come on top only for main page and not any others?
    for example, if user comes to my mainpage, i would like sidebar to come up on top on mobile.
    but if user moves to a specific page or a post or any other pages other than main page, i would like sidebar to behave as usual (show below main contents) on mobile view.

    i know i can control visibility but it is so hard to set up visibility for every possible scenario.

    The blog I need help with is maranathavc.org.

    #152210

    tarasdashkevych
    Theme Author

    Hello,

    Please use this custom CSS instead:

    
    @media (max-width: 500px) {
      #homepage-widgets .row {
        display: flex;
        flex-wrap: wrap;
      }
      
      #homepage-widgets .row > * {
        width: 100%;
      }
      
      #homepage-widgets .row .home-widgets-inner {
        order: 2;
      }
      
      #homepage-widgets .row .col-lg-4 {
        order: 1;
      }
    }
    

    Hope this helps. Let me know if you have any additional questions.

    Kind regards,
    Taras

    #152213

    maranathavc
    Member

    this does not seem to work. i added above code in ‘additional CSS’ yet sidebar is appearing when i click on a post or on a page. please advise.

    #152225

    tarasdashkevych
    Theme Author

    Hi,

    Have you managed to resolve the issue? I’ve checked your site and the sidebar is shown at the top on the Front Page page when viewing via a mobile devices.

    Also, the sidebar is hidden in singular views.

    Kind regards,
    Taras

    #152232

    maranathavc
    Member

    no i have not. i still have the css that you provided me to have sidebar appear on top on mobile. i have disabled new css posted up there. i have conditionally controlled visibility of sidebars for one category and that is it. all the other pages/posts will show sidebar.

    #152243

    tarasdashkevych
    Theme Author

    Hi,
    Thank you for providing additional information.

    I’ve checked your site and it looks like you are using a wrong custom CSS on your site.

    Could you please remove from your site this CSS: https://premium-themes.forums.wordpress.com/topic/how-to-make-sidebar-appear-on-left-and-not-right/#post-152179 ?

    And then use this one instead: https://premium-themes.forums.wordpress.com/topic/follow-up-question-to-below-question-about-putting-sidebar-on-top-on-mobile-view/#post-152210

    So, it will move the sidebar section to the top on mobile devices only when viewing your front page (https://maranathavc.org/).

    Hope this helps. Let me know if you need additional help.

    Thank you,
    Taras

    #152245

    maranathavc
    Member

    thank you i will try that option as well.

    i found another potentially easier option. on side widget visibility, i choose

    hide if category is all category
    hide if page is page

    this removes sidebar from all views except for main page. this seems to work. thank you!

    #152246

    maranathavc
    Member

    i was wrong above.

    easier way is to

    show if page is front page.

    #152262

    tarasdashkevych
    Theme Author

    Hi,

    Correct. This will hide the sidebar in all pages expert the static front page.

    I’ve thought that you want to keep the sidebar in other pages but you do not want to move it to the top in mobile devices (only for the home page).

    Please let me know if you have any additional questions.

    Kind regards,
    Taras

The topic ‘follow up question to below question about putting sidebar on top on mobile view’ is closed to new replies.