WordPress Coding
How to include css Based on Condition in WordPress

How to include css Based on Condition in WordPress

By: SolutionsHint    69 views Updated: 04th Apr, 2018
Include css Based on Condition

Include CSS in WordPress is quite a simple task but for beginner WordPress developer so WordPress provide hook and action by with the help of that we can include script and stylesheet into our WordPress project. when we talk about including CSS and js on specific condition for a page and posts.

So here I am going to explain how to add stylesheet on a single page of WordPress post, because if you want to include specific CSS for a specific page then you can follow these steps.

How to Include Stylesheet Only For Single Post WordPress

Step 1: Go to your WordPress theme directory

Step 2:You can go as : wp-content/themes/your theme/css/createcsshere (Suppose you created “custom.css”)

Step 3: Now you have created custom CSS in your theme directory and path is  wp-content/themes/your theme/css/custom.css

Step 4: Now go to Themes function and open functions.php and add following code

Step 5: Done

About the Author

I am a professional blogger from my heart, I am going through all the possible ways that can help to audience. I am trying my best to write content that my readers will like me. I will really be happy when my readers will become more happy with my blog.

Leave a Reply

Your email address will not be published. Required fields are marked *