Instantly share code, notes, and snippets.

Embed
What would you like to do?
[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