[Support request] archive, blog, author page background color

Home Forums Support [Support request] archive, blog, author page background color

Home Forums Support archive, blog, author page background color

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1671047
    Nikos

    hi!!
    on 18 february you taught me how to change the colors of a page or post.
    https://generatepress.com/forums/topic/pages-and-posts-background-color/
    but what if i want to change the background color of an archive page?
    i am not sure if it is the right term, but for example, i mean when we choose to see all the posts of a category, they open in a new page and we see them all together. or when we click the name of an author, there is a new page with all the author’s post. or when we make a search again a new page is coming up with all the results there.
    i am not sure if it is the same page id as the block. or it is call archive page etc.
    so i would like to ask how i can find the id of that kind of pages so i would use it in the method that you taught me.
    thank you very much

    #1671090
    Ying
    Staff
    Customer Support

    Hi Nikos,

    You are right they are called archive pages.

    If you are using chrome, open the archive page in chrome > right click > inspect, that’s how you open chrome developer tool, or press F12.

    Then you can find the author ID of this page, in this case it’s author-31
    https://www.screencast.com/t/PnNTsa1nHvQ

    So your CSS would be this, test to see the difference between these 2 selectors.

    .author-31 #page {
        background-color: #9823;
    }
    .author-31 {
        background-color: #6666;
    }

    And the same for the tag archive page, in this case it’s tag-5.
    https://www.screencast.com/t/6fWMN2svCYE

    Hope my explanation helps πŸ™‚

    #1671627
    Nikos

    hi ying
    oh i understand and for the categories it is category-no23 for example etc etc πŸ™‚
    but is it a way to color everything at once? for example .author-“all” (all author archives will have the same background) or .tags-“all” (all tag archives will have the same background) or category.”all” etc?
    thank you very much !!!!

    #1671749
    David
    Staff
    Customer Support

    Hi there,

    WordPress adds various classes to the <body> if your site. Known as body classes.

    So:

    .archive {
        /* All Archive pages */
    }
    .archive.author {
        /* only and all of the author archive pages */
    }
    .archive.category {
        /* only and all of the category archive pages */
    }
    .archive.tag {
        /* only and all of the tag archive pages */
    }
    #1671757
    Nikos

    thank you thank you thank you !!! (both of you) πŸ™‚ πŸ™‚ πŸ™‚

    #1671797
    David
    Staff
    Customer Support

    Glad we could be of help

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.