Skip to content

WordPress Akademi

  • Başlangıç
    • Kod Standartları
    • CSS & HTML
    • WP geliştirme araçları
  • Tema
    • Tema Düzenleme ve geliştirme
  • Son Eklenenler
  • Slack Grubu
  • Testler
  • İletişim

Inline CSS ekleme

  • 0
  • Posted by alidemirci

WordPress’de inline CSS direkt <style> taglari ile eklenmiyor. Asagidaki gibi bir tane placeholder dosya olusturacagiz ama kodlar orda gorunmicak inline sekilde goruncek yukledigimiz yerde

// Adding Fall-back image to Home Hero Video

function amc_detect_ios_version(){
    if(stripos($_SERVER['HTTP_USER_AGENT'],"iPhone")) {
        return preg_replace("/(.*) OS ([0-9]*)_(.*)/","$2", $_SERVER['HTTP_USER_AGENT']);
    } else {
        return false;
    }
}


if(amc_detect_ios_version() && amc_detect_ios_version() < 11 ){
    

		function amc_add_inline_css() {

				wp_enqueue_style(
					'amc-custom-style',
					get_stylesheet_directory_uri() . '/css/amc-custom-style.css'
				);

				$custom_css = ".et_pb_section_video_bg{ display:none; }";

				wp_add_inline_style( 'amc-custom-style', $custom_css );
		}
		add_action( 'wp_enqueue_scripts', 'amc_add_inline_css' );


  }

← Previous Lesson

Post navigation

Header & Footer
Custom Query
Proudly powered by WordPress.