• Resolved robhills1985

    (@robhills1985)


    Theme: Astra (free)

    Issue 1 (solved): keep sidebar displayed on the right of post content on tablet view, but keep mobile view to default (css code below)

    Issue 2 (created by the solution to Issue 1): even on pages that have the sidebar disabled, the page content is now contained in the area specified by CSS written for Issue 1.

    CSS code:

    @media only screen and (max-width: 60em) and (min-width: 40em) {
    .ast-right-sidebar #secondary  {
    clear: none;
    float: right;
    width: 35%;
    margin: 1em 0px 0px;
    }
    #primary {
    float: left;
    padding-right: 0px;
    width: 60%;
    }
    }
    _________

    Thank you to anyone even reading/considering an assist ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Look at the<body> tag and you’ll see posts and pages are given different classes, so you can use them (via explicity adding to a CSS selector or using in a “not:” scenario) to target posts or pages.

    If you want to get theme-specific, I recommend asking at https://www.ads-software.com/support/theme/astra#new-post so the theme’s developers and support community can help you with this.

    Thread Starter robhills1985

    (@robhills1985)

    Hi @sterndata,

    Thank you! After a bit of trial and error, this seems to work (although I am not sure if it is the cleanest way of doing it as I have little understanding of what I am doing, just in magpie mode, stealing bits of code from here and there and stitching together!)

    @media only screen and (max-width: 60em) and (min-width: 40em)  {
    .ast-right-sidebar  #secondary  {
        clear: none;
        float: right;
        width: 35%;
        margin: 1em 0px 0px;
    }
    }
    
    @media only screen and (max-width: 60em) and (min-width: 40em)  {
    .single-post #primary  {  
        float: left;
        padding-right: 0px;
        width: 60%;
    }
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Use custom CSS on all posts, not pages’ is closed to new replies.