function be_header_menu_desc( $item_output, $item, $depth, $args ) { if ( 'main_menu' == $args->theme_location && !…
Add custom Icon Shortcode
//LOAD LINEARICONS (you need the webfont and the css)
/*
function enym_linearicons_css(){
wp_enqueue_style( 'linearicons', get_stylesheet_directory_uri() . '/css/linearicons.min.css' );
}
add_action( 'wp_enqueue_scripts', 'enym_linearicons_css', 99 );
*/
//ADD LINEARICONS SHORTCODE
function enym_icon_shortcode( $atts ) {
$atts = shortcode_atts(
array(
'icon' => '',
'size' => '',
),
$atts
);
if($atts['size'] != "") {
$size = ' style="width:'.$atts['size'].'"';
}
$terms = '<img src="/wp-content/themes/total-child-theme/icons/'.$atts['icon'].'"'.$size.' class="enymicon">';
return $terms;
}
add_shortcode( 'icon', 'enym_icon_shortcode' ); //use like [icon icon='FILENAME' size='100px']
Dieser Beitrag hat 0 Kommentare