Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wordpress- Can't figure out how to load @font-face

Featured Replies

So I'm having a play around with Wordpress, and it's proving a lot trickier than I first thought! At the minute I'm stuck with Wordpress finding my custom fonts. They load fine when they are in the theme folder and are in the CSS as:

 

@font-face {
font-family: 'prostoregular';
src: url('prosto-webfont.eot');
src: url('prosto-webfont.eot?#iefix') format('embedded-opentype'),
	 url('prosto-webfont.woff') format('woff'),
	 url('prosto-webfont.ttf') format('truetype'),
	 url('prosto-webfont.svg#prostoregular') format('svg');
font-weight: normal;
font-style: normal;
}

 

However I have created a folder called 'fonts' in my theme folder but when I have this in the CSS:

 

@font-face {
font-family: 'OpenSansRegular';
src: url('../fonts/OpenSans-Regular-webfont.eot');
src: url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
	 url('../fonts/OpenSans-Regular-webfont.woff') format('woff'),
	 url('../fonts/OpenSans-Regular-webfont.ttf') format('truetype'),
	 url('../fonts/OpenSans-Regular-webfont.svg#OpenSansRegular') format('svg');
font-weight: normal;
font-style: normal;
}

 

it won't find these fonts. I have tried going one deeper each time and it's not having it ( for example /htdocs/wp-content/themes/twentytwelve/fonts ).

 

Any ideas?

Thanks.

 

 

After all that I was overcomplicating things -

   url('fonts/OpenSans-Regular-webfont.woff') format('woff')

works, didn't need the

/

before fonts.

Edited by jpwd

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.