php - How to set font face for internet explorer in WordPress? -
i setting font face internet explorer in wordpress
all of fonts located inside root directory of child theme.
this code in ie-only.css
@media screen , (-ms-high-contrast: active), (-ms-high-contrast: none) { @font-face { font-family: 'open_sansregular'; src: url('opensans-regular-webfont.eot'); src: url('opensans-regular-webfont.eot?#iefix') format('embedded-opentype'), url('opensans-regular-webfont.woff2') format('woff2'), url('opensans-regular-webfont.woff') format('woff'), url('opensans-regular-webfont.ttf') format('truetype'), url('opensans-regular-webfont.svg#open_sansregular') format('svg'); font-weight: normal; font-style: normal; } .text-highlight { border: 1px solid red; font-family:open_sansregular; } }
do know proper address locate font family in root directory of child theme?
any appreciated. thanks
i think have not set font path correnctly try code.
@font-face { font-family: 'open_sansregular'; src: url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.eot'); src: url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.eot?#iefix') format('embedded-opentype'), url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.woff2') format('woff2'), url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.woff') format('woff'), url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.ttf') format('truetype'), url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.svg#open_sansregular') format('svg'); font-weight: normal; font-style: normal; }
Comments
Post a Comment