Skip to content

Instantly share code, notes, and snippets.

@DavidPeralvarez
Last active September 24, 2018 14:19
Show Gist options
  • Save DavidPeralvarez/549759c709b745e5a3cef69234dbbc76 to your computer and use it in GitHub Desktop.
Save DavidPeralvarez/549759c709b745e5a3cef69234dbbc76 to your computer and use it in GitHub Desktop.
Cómo insertar Font Awesome v5 en WordPress
/* estilos generales */
.icon::before {
display: inline-block;
font-style: normal;
font-variant: normal;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
}
/* estilos de la versión 5, mostrando el icono de facebook */
.icono-facebook::before {
font-family: "Font Awesome 5 Free";
font-weight: 400; /* para marcas */
content: "\f09a";
}
/* estilos de la versión 5, mostrando el icono de un laptop */
.icono-laptop::before {
font-family: "Font Awesome 5 Free";
font-weight: 900; /* para solid */
content: "\f109";
}
<?php
/**
* Enqueue scripts and styles for front end.
*
*/
function scv_scripts_styles() {
//Código existente dentro de la función
}
add_action( 'wp_enqueue_scripts', 'scv_scripts_styles' );
<?php
/**
* Enqueue scripts and styles for front end.
*
*/
function scv_scripts_styles() {
//Código existente dentro de la función
//Enqueue font awesome
wp_enqueue_style( 'font-awesome', get_stylesheet_directory_uri().'/fontawesome/css/all.min.css' );
}
add_action( 'wp_enqueue_scripts', 'scv_scripts_styles' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment