• I’m a WP newbie and I think this plugin is exactly what need.

    I have created a new stylesheet, but the fonts I defined there are being applied to the entire site. How do I apply it to just a section of my site (like to just the POSTS)?

    I assumed this was something the plugin could do since in the screenshot example I see: Homepage Styles, Post Styles, Page Styles, Slideshow Styles.

    Thanks!

    https://ww.wp.xz.cn/plugins/joddit-global-css/

Viewing 1 replies (of 1 total)
  • Plugin Author joddit

    (@joddit)

    I didn’t want to build any proprietary techniques into the plugin because then I would end up getting requests like “How do you apply styles to the whole site instead of just a single page”.

    On top of that, this functionality has been built into WordPress for many, many years. Each post that you create has an ID associated with it for reference in the database. When WordPress pulls the post data from the database and parses it into the HTML and CSS that your website users see, it tags the CSS with many useful ID’s and Classes.

    To restrict your CSS to a single Post, you would begin your css line with .postid-12 to restrict your CSS to the post with an id of 12.

    Side note, you can also restrict CSS to a single Page by beginning your CSS line with .page-id-12 for the page with id 12.

    I hope this helps.

Viewing 1 replies (of 1 total)

The topic ‘Applying a new CSS only to POSTS’ is closed to new replies.