Support » Fixing WordPress » Custom Fonts in Editor-style.css

  • I created an editor-style.css document, and added the appropriate lines to my functions.php file. So, now my WordPress textarea editor (for posts and pages) shows my site’s styles. However, the custom fonts that I use in my template don’t show up in the editor window…

    I define my fonts in my header.php file…

    <style>
    @font-face {
      font-family: 'GothamBold';
      src: 	url('<?php bloginfo('stylesheet_directory'); ?>/GothamBold.eot?#iefix') format('embedded-opentype'),  
      		url('<?php bloginfo('stylesheet_directory'); ?>/GothamBold.woff') format('woff'), 
    		url('<?php bloginfo('stylesheet_directory'); ?>/GothamBold.ttf')  format('truetype'),
    		url('<?php bloginfo('stylesheet_directory'); ?>/GothamBold.svg#GothamBold') format('svg');
      font-weight: normal;
      font-style: normal;
    }
    
    @font-face {
      font-family: 'GothamLight';
      src:  url('<?php bloginfo('stylesheet_directory'); ?>/GothamLight.eot?#iefix') format('embedded-opentype'),  
      		url('<?php bloginfo('stylesheet_directory'); ?>/GothamLight.woff') format('woff'), 
    		url('<?php bloginfo('stylesheet_directory'); ?>/GothamLight.ttf')  format('truetype'), 
    		url('<?php bloginfo('stylesheet_directory'); ?>/GothamLight.svg#GothamLight') format('svg');
      font-weight: normal;
      font-style: normal;
    }
    </style>

    So, I understand why the fonts wont show up in the core administration (because header.php is a site template file). So, where do I add these font paths so the fonts change in my editor window? I’m trying to avoid editing any core files (for obvious reasons), and would like to avoid adding any plugins. Is there a way to add this via my functions.php file … or somewhere else?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Custom Fonts in Editor-style.css’ is closed to new replies.