How to Add Custom CSS or Script On All Pages But Homepage in WordPress

If you want to add custom css on all the pages of a WordPress website except the homepage, you can do it via something like this. Put this code in the header.php of your theme file

In place of .yourcssclass you need to use your own css classes. This setting will work if you have a page set as front page from the reading settings.

In order to use custom css in some themes where homepage is not controlled by a page but from widget or theme settings, you can use

How To Create Your Own Shortcode For Clear Property in WordPress

How To Create Your Own Shortcode For Clear Property in WordPress

When writing HTML code or working with WordPress pages, we often come across a situation where we want to clear areas and put next div or element on next line instead of floating with previous block.

You can write quick HTML to fix such issues. But in case of repeated situation, you may create this handy code using WordPress shortcode feature. Add the following lines in your theme’s funtions.php and use the [clear] shortcode you clear the areas on left and right in HTML.

Step 1:

function ad_clear_shortcode( $atts , $content = null ) {

// Code
return '

add_shortcode( 'clear', 'ad_clear_shortcode' );

Step 2:
And when you want to use the clear property, you can simply use the shortcode [clear] instead of using the long


Backup of funtions.php is recommended before making any change to it so that you can restore it via FTP or file manager in order something goes wrong in editing.