Site logo

[Support request] Adding Custom CSS and HTML for Single Post

Home Forums Support [Support request] Adding Custom CSS and HTML for Single Post

Home Forums Support Adding Custom CSS and HTML for Single Post

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2448384
    Mihail

    Hello,

    I want to add custom CSS for a single post. I use the Custom HTML block for the HTML, but I can’t find how to add custom CSS. I added custom CSS in Customize –> Additional CSS , but it displays in the entire site.

    Is there a way to add custom CSS code to one particular post only, not on every post. I don’t want extra code to load to slow my website down.

    Thank you,
    Mihail.

    #2448967
    David
    Staff
    Customer Support

    Hi there,

    in the HTML block you can add your CSS, simply wrap it in style tags ie.

    <style>
    your CSS here
    </style>

    as a general rule, if you’re adding a few lines of CSS, then don’t be bothered doing this, it won’t make any real performance improvements over adding it to the customizer.

    IF however your’re loading 100 to 1000s of lines of CSS on a specific page then you will want to consider a child theme and enqueueing stylesheets for that.

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