I want to include my style.css in function.php file?

You are calling the function wrong. You have not given your filename, just a directory. From the codex wp_enqueue_style( string $handle, string $src = false, array $deps = array(), string|bool|null $ver = false, string $media=”all” ) so in your case, you should enqueue like so add_action( ‘wp_enqueue_scripts’, ‘wpse_my_style’ ); function wpse_my_style(){ wp_enqueue_style( ‘my-style’, get_stylesheet_directory_uri() . … Read more

I register and enqueue stylesheet but nothing is rendered

You’re doing well – just one thing you need to change, and I reckon it’s a totally reasonable mistake to make: This: add_action(‘wp_enqueue_styles’, ‘alpha_styles’); needs to become add_action(‘wp_enqueue_scripts’, ‘alpha_styles’); Why scripts? Because there is no WordPress action called wp_enqueue_styles. Although the functions are named wp_register_style & wp_enqueue_style, you still need to hook them to the … Read more

Google fonts enqueue only imports last font family

From the wp_enqueue_style() documentation: $ver (string|bool|null) (Optional) String specifying stylesheet version number, if it has one, which is added to the URL as a query string for cache busting purposes. If version is set to false, a version number is automatically added equal to current installed WordPress version. If set to null, no version is … Read more

Enqueue stylesheet depending on template

You need to first register the style and then en-queue it! This might work! function custom_style_method() { wp_register_style( ‘paralax_style’, get_template_directory_uri().’/paralax.css’ ); } add_action(‘wp_enqueue_scripts’, ‘custom_style_method’); add_filter( ‘template_include’, ‘themename_include_page_specific_css’, 1000 ); function themename_include_page_specific_css( $template ){ if ( is_page_template(‘single-location.php’ ) ) { wp_enqueue_style( ‘paralax_style’ ); } return $template; }

To enqueue or not to enqueue

Method 2 You can enqueue all of your stylesheets form the same place even controlling where the stylesheets load by means of template conditionals, which is convenient and prevents a lot of mess in your <head>. You can remove enqueued stylesheets if you need to via a plugin, for example. Enqueued stylesheets are child theme … Read more

My child theme CSS get called twice

You don’t need to enqueue your child theme’s stylesheet. The parent theme does that for you. TwentySeventeen has this line: wp_enqueue_style( ‘twentyseventeen-style’, get_stylesheet_uri() ); That’s still going to run, but twentyseventeen-style is now your child theme’s stylesheet. You just need to enqueue the parent theme’s stylesheet: /** Enqueue the parent and child theme stylesheets **/ … Read more

wp_add_inline_style in plugin not working

Here’s a solution based on this post, which allows the inline CSS to be rendered by a shortcode using a dependency without a path (basically a null file). // Optional base styles add_action( ‘wp_enqueue_scripts’, ‘cod_enqueue_scripts’ ); function cod_enqueue_scripts() { wp_enqueue_style(‘cod-style’, plugins_url(‘css/style.css’, __FILE__)); } // Shortcode handler which also outputs inline styles. add_shortcode( ‘cod’, ‘cod_process_shortcode’); function … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)