Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [WordPress] wp_add_inline_style nie działa
AboutMe
post
Post #1





Grupa: Zarejestrowani
Postów: 261
Pomógł: 0
Dołączył: 24.02.2008

Ostrzeżenie: (0%)
-----


Wkleiłem poniższy kod do functions.php

  1. function my_styles_method() {
  2. wp_enqueue_style(
  3. 'custom-style',
  4. get_template_directory_uri() . '/css/custom_script.css'
  5. );
  6. $color = #FF0000; //E.g. #FF0000
  7. $custom_css = "
  8. .mycolor{
  9. background: {$color};
  10. }";
  11. wp_add_inline_style( 'custom-style', $custom_css );
  12. }
  13. add_action( 'wp_enqueue_scripts', 'my_styles_method' );



custom_script.css jest wyświetlany w źródle strone ale niestety sam plik custom_script.css jest pusty, chmod to 644

https://codex.wordpress.org/Function_Refere...dd_inline_style

Ten post edytował AboutMe 24.08.2015, 17:14:26
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 17:52