• Resolved jp63

    (@jp63)


    Is there possible to assign CSS and a header image to a category ?

    (and even to an unique post or page)

    I would need the selectors used in OceanWP.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Theme Author oceanwp

    (@oceanwp)

    Hello, you will need to do this manually, the header selector is “#site-header”.

    Thread Starter jp63

    (@jp63)

    Hello,

    I’ve tried with this :

    .champagne #site-header {
    background: url(https://www.musimage.ch/wp-content/uploads/champagne.jpg) no-repeat transparent;
    }

    Seems right but not working… Some docs about the OceanWP selectors would be very handful.

    Thank you very much 🙂

    Theme Author oceanwp

    (@oceanwp)

    Hi, can you show me the url where you want to do this?

    Thread Starter jp63

    (@jp63)

    Hi Oceanwp,

    It’s https://www.musimage.ch

    I’ve tried also with this

    .champagne #page-header {
    background-image: url( https://www.musimage.ch/wp-content/uploads/champagne.jpg ) no-repeat transparent;
    }

    But it don’t work

    I miss some Oceanwp selectors doc.

    Thank you very much

    Theme Author oceanwp

    (@oceanwp)

    The homepage is the page where you want to add the image? Where do you want to add it? In the header, title, in the background of your site?

    Thread Starter jp63

    (@jp63)

    This is the image in the header (960 x 160) that you can see. There are others images for some others categories, in the same dimensions.

    Could be nice to have also header’s images assigned to a specific post or page.

    The only issue is no having documentation about the right selectors, so it’s uneasy to write some CSS.

    Thank you very much

    Theme Author oceanwp

    (@oceanwp)

    If you want to add an image to the header for a specific post, you need to add a css code like this:

    .postid-66 #site-header {
    background-image: url( https://www.musimage.ch/wp-content/uploads/champagne.jpg ) no-repeat transparent;
    }

    Replace “66” by your post ID.

    Thread Starter jp63

    (@jp63)

    I tried the CSS code but it doesn’t work.

    Tried also with #page-header (in the source of the page, the banner’s image is the page header) and also without space in the url

    .postid-66 #site-header {
    background-image: url(https://www.musimage.ch/wp-content/uploads/champagne.jpg) no-repeat transparent;
    }

    So strange !

    Theme Author oceanwp

    (@oceanwp)

    Hi, you have not replaced “postid-66” by your own post ID so it is normal that it doesn’t work. But why not adding your image directly via the Header > Header MEdia section of the customizer?

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘CSS & header image relative to a category’ is closed to new replies.