html - Why can't I get @font-face to work on custom fonts for wordpress? -


i'm using wordpress , find impossible custom fonts work on site. i've looked through several threads same problem , none of solutions worked or applied them wrong. use free theme i'm modifying go along. i'm editing style.css sheet , can't figure out i'm doing wrong. fonts work can found on computer (and don't, if can found on pc), there seems weird going on. none of @font-face things work on other devices.

i used font squirrel make set of webfonts , uploaded them server, under theme in separate font folder. files should accessible permissions granted user, group, world read , execute. tried using font squirrel provided code added complete addresses implement fonts. nothing happens.

now first day coding might i'm not seeing i'm doing wrong here. inserted new code after heading-headline (i'm not sure if positioning in sheet makes difference or user organizational purposes, i've tried several) in style file , strip on file:

.blog-title {     font-family: "daniel_blackregular";     font-size: 2.25em;     text-align: center; }  @font-face {     font-family: 'daniel_blackregular';     src: url('/public_html/wp-content/themes/baskerville/fonts/danielbk.eot');     src: url('/public_html/wp-content/themes/baskerville/fonts/danielbk.eot?#iefix') format('embedded-opentype'),          url('/public_html/wp-content/themes/baskerville/fonts/danielbk.woff2') format('woff2'),          url('/public_html/wp-content/themes/baskerville/fonts/danielbk.woff') format('woff'),          url('danielbk.ttf') format('truetype');     font-weight: normal;     font-style: normal; } 

right i'm thinking if i'm addressing font incorrectly, i've tried there too. please help.

to fix issue need few things.

  1. move @font-face top of css file.

  2. update url path in @font-face call. right returning 404 urls of:


@font-face { font-family: 'daniel_blackregular'; src: url('/fonts/danielbk.eot'); src: url('/fonts/danielbk.eot?#iefix') format('embedded-opentype'),      url('/fonts/danielbk.woff2') format('woff2'),      url('/fonts/danielbk.woff') format('woff'),      url('/fonts/danielbk.ttf') format('truetype'); font-weight: normal; font-style: normal; } 

remember urls relative call coming from. in case it's gettning called css.

when updated paths in css to: src: url('/public_html/wp-content/themes/baskerville/fonts/danielbk.eot'); font worked.


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -