Shortcode in Menu no longer works.
-
I have the following Code in my functions.php:
// Filter to use Shortcode in Text Widgets add_filter('widget_text', 'do_shortcode'); // Filter to use Shortcode in Navigation Menus add_filter('wp_nav_menu', 'do_shortcode', 11); // [fa set="fas" icon="wordpress"] function faicon_shortcode( $atts ) { $a = shortcode_atts( array( 'set' => 'fas', 'icon' => 'wordpress', 'size' => '', 'color' => '', ), $atts ); // Check if Icon Size is Set if (isset($a['size']) && $a['size'] !== ''){ $icon_size = ' fa-' . $a['size']; } else { $icon_size = ''; } // Check if Icon Color is Set if (isset($a['color']) && $a['color'] !== ''){ $icon_color = ' style="color: '.$a['color'].';"'; } else { $icon_color = ''; } // Generated Code to insert return '<i class="'.$a['set'].' fa-'.$a['icon'].$icon_size.'"'.$icon_color.'></i>'; } add_shortcode( 'fa', 'faicon_shortcode' );
So far it has worked great. Recently, however, it hasn’t worked anymore. Does anybody have any idea what could be causing it In the widget the icon is displayed. In the navigation menu the i-tag is shown but the icon does not appear!
Would be grateful for a tip!
Greeting Sascha
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Shortcode in Menu no longer works.’ is closed to new replies.