• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Different CSS on posts and archive page

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Different CSS on posts and archive page

This topic is: resolved

Tagged: archives, css, custom child theme, Headers, hooks, posts

  • This topic has 2 replies, 2 voices, and was last updated 12 years, 5 months ago by [email protected].
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • February 12, 2013 at 8:50 am #19817
    [email protected]
    Participant

    Hi, I am making a theme for a client on my test domain at
    http://test4.e9designs.com
    It is a custom child theme based on the Genesis theme.

    I asked the following question on the forum at WordPress.org, and they said that since I'm using Genesis, I shouldn't be doing this kind of hack. Genesis probably provides hooks for this kind of thing already. They said to ask here, and that you would tell me to put the image(s) via this whatever_before_post_title hook. I do not understand what to do, so here is my original question, as I posted it over there:

    ---

    The client wants TWO headers on each page. The top header has the blog's title, but the background images rotate depending on the category the visitor is viewing. With the use of the "Unique Headers" plugin, I've got that working.

    The second header is visible on all pages except index. It will have the category title, and again, the background images should rotate depending on which category it is.

    I have NOT been able to figure this out, so I cheated and just uploaded a background image into the code, like this:
    /* Category Headers
    ------------------------------------------------------------ */

    body.single-business div.post {
    background: url('http://test4.e9designs.com/wp-content/uploads/2013/02/business-large.png') no-repeat center top;
    padding: 0px 0px 164px 0px;
    }

    body.single-wisdom div.post {
    background: url('http://test4.e9designs.com/wp-content/uploads/2013/02/wisdom-large.png') no-repeat center top;
    padding: 0px 0px 164px 0px;
    }

    body.single-nature div.post {
    background: url('http://test4.e9designs.com/wp-content/uploads/2013/02/nature-large.png') no-repeat center top;
    padding: 0px 0px 164px 0px;
    }

    On the posts, I used the "Ambrosite Body Class Enhanced" plugin to help me define classes for each category in the CSS. Maybe I didn't need it, but I'm still learning, and this seemed to work.

    On the category archives pages, I went into the Category section of the dashboard and just added an image to the Archive Intro Text of the Category Archive Settings.

    The problem, which you can see an example of at
    http://test4.e9designs.com/category/business/
    is that there is a huge white space under the 2nd header, before the post content begins.

    It looks just fine on the post pages, as you can see at
    http://test4.e9designs.com/sample-post-with-headlines/

    Here is the offending code:
    #content .post {
    border-bottom: 1px solid #DFDFDF;
    margin: 0;
    overflow: hidden;
    padding: 174px 20px 15px;
    }

    I am *sure* there is a better way to do this, but I just can't figure it out.

    Even worse, I don't like that all these images are coded into the CSS style sheet, because my client was really hoping to be able to make these changes himself, through the media library. However, I think it's getting beyond my skills, unless I could find a plugin to solve the problem.

    Can anyone advise? Thank you *so* much!
    ~Anne

    February 12, 2013 at 9:55 am #19831
    Brad Dalton
    Participant

    This will work if you use the same header height wp display header plugin


    Tutorials for StudioPress Themes.

    February 12, 2013 at 12:35 pm #19854
    [email protected]
    Participant

    That is FABULOUS! Thank you, thank you!

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble