• Resolved siddardha

    (@siddardha)


    I needed a custom page developed and asked my developer that the page CSS shouldn’t load on other pages.

    He included the CSS in the same PHP file when creating the page.

    Is this the best practice or is there a better solution like having a different CSS file or using a plugin to add CSS for that particular page only?

Viewing 3 replies - 1 through 3 (of 3 total)
  • “Best”?
    Since you want that CSS only on that one page, it is best loaded by the page template itself (it sounds like what you are describing as PHP file).
    If the CSS is inline, it will be zipped with the rest of the page (if gzip is enabled on your server), and the entire page is cached together.
    If the CSS is a separate file, it requires another HTTP request, and it can be cached separately from the page, which doesn’t benefit anyone since it’s only used on that page.
    So it sounds like your developer did the “best” thing, and you should trust that more.

    Thread Starter siddardha

    (@siddardha)

    @joyously Thank you for the clarification 🙂

    Do you also know how to reduce time to work on css and js , its really headech for me, loading speed is slow because of that – you can check for this site – dricki.com, for gtmetrix its good but for real users its little slow. Can you guide me ? its on seo lounge theme.

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

The topic ‘Custom page CSS’ is closed to new replies.