Skip to content

Instantly share code, notes, and snippets.

@tommcfarlin
Created September 12, 2018 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommcfarlin/f68f25673c0c131c8d5352b65b23cc01 to your computer and use it in GitHub Desktop.
Save tommcfarlin/f68f25673c0c131c8d5352b65b23cc01 to your computer and use it in GitHub Desktop.
[WordPress] Including Custom Fonts in WordPress Plugins
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
font-family: 'Roboto', sans-serif;
@font-face {
font-family: GothamLight;
src: url("../fonts/Gotham-Light.otf") format("opentype");
}
@font-face {
font-family: ThirstyScriptMedium;
src: url("../fonts/ThirstyScriptMedium.otf") format("opentype");
}
#search_keywords {
background: #ffffff;
color: #151335;
font-family: 'GothamLight', sans-serif;
}
<?php
add_action('wp_enqueue_scripts', 'acme_enqueue_styles');
/**
* Registers the stylesheet for the Acme Plugin Styles.
*/
function acme_enqueue_styles()
{
wp_enqueue_style(
'acme-visuals',
plugin_dir_url(dirname(__FILE__)).'assets/css/public.css',
[],
rand(),
'screen'
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment