Apply CSS to a specific blog

Solved
pearlerwork
Excursionist
19 0 5

Anyone know how I can make it so my CSS only applies to a specific Blog? For example, I have one called 'Journal' for traditional blog posts, and another called 'Press' which I want to style a bit differently. Thanks!

0 Likes

Hello,

Please share:
- your store URL;
- page URL with the issue you mention;
- storefront password (if your store has one).

Kind regards,
Diego

◦ Product page slider & thumbnails with swiping for free themes: Minimal | Debut | Brooklyn | Supply
◦ Replace apps with simple copy/paste code snippets. Examples clicking here.
pearlerwork
Excursionist
19 0 5

Hello, it's an unpublished theme - but the site is live

ellusandkrue.myshopify.com
https://ellusandkrue.com.au/blogs/media

 

Thank you

0 Likes

@pearlerwork 

Please share the unpublished theme URL.

You can quickly generate an unpublished theme shareable URL by following these instructions.

Thank you!

◦ Product page slider & thumbnails with swiping for free themes: Minimal | Debut | Brooklyn | Supply
◦ Replace apps with simple copy/paste code snippets. Examples clicking here.
0 Likes
PBC
Excursionist
15 3 9

This is an accepted solution.

Hi 

<div class="page-width page-content {% if blog.handle == "press" %}press-blog-class{% endif %}">

This will add class "press-blog-class" to the blog with handle "press"

After that you can make customizations using this class

pearlerwork
Excursionist
19 0 5

Awesome! .press-blog-class works great

0 Likes
DoctorDoctor
Tourist
7 0 2

I have no <div class="page-width page-content"> but <div class="page-width">.
Will this

 

<div class="page-width {% if blog.handle == "interviews" %}interviews-blog-class{% endif %}">

 

still work?

How can I assign the handle "interviews" to a specific blog? I mean, I can now write a style for the .interviews-blog-class, but where can I associate this class to a blog?