wordpress custom theme मे style.css काम नहीं कर रहा तो क्या करे ?

style.css

यह wordpress थीम मे होने वाली एक फाइल है जिसमे css coding कर के थीम को सुंदर बनाया जा सकता है ।

कैसे करे

जब आपके कस्टम थीम मे style.css की फाइल न काम करे तो आप कुछ स्टेप्स फॉलो कर के उस परेशानी को ठीक कर सकते है –

1-function.php
अपने थीम के function.php मे नीचे दिए हुए कोड को पेस्ट करें

function thekroyaard_style() {
// Note, the is_IE global variable is defined by WordPress and is used
// to detect if the current browser is internet explorer.
global $is_IE, $wp_scripts;
if ( $is_IE ) {
// If IE 11 or below, use a flattened stylesheet with static values replacing CSS Variables.
wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/assets/css/ie.css', array(), wp_get_theme()->get( 'Version' ) );
} else {
// If not IE, use the standard stylesheet.
wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) );
}

}
add_action( 'wp_enqueue_scripts', 'thekroyaard_style' );

2-header.php
अब आप header.php मे जाए और head section मे नीचे दिए हुए कोड को पेस्ट कर दें –

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>"
type="text/css" media="screen" />
<link ref="stylesheet" href="style.css"/>

इस तरह से आप style.css की फाइल को काम लायक बना सकते है । यदि और कोई प्रॉब्लेम हो तो कमेन्ट करें ।

Watch Video