I am setting up a font face for internet explorer only in WordPress
All of the fonts are located inside the root directory of child theme.
This is the code in ie-only.css
@media screen and (-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 you know what is the proper address to locate the font family in the root directory of the child theme?
Any help is appreciated. Thanks
I think you have not set font path correnctly try this code.
I was able to solve my issue.
To enable font face in Internet explorer, create a separate css for IE.
Example:
get_stylesheet_directory_uri() will get the directory of the child theme
Now in the ie-only.css
All of the font files declared above should be available within the directory your are working with.
Thanks.