Unyson
Unyson copied to clipboard
Enqueue google font from BUILDER
Hi
I have seen several solutions to use google webfonts from theme settings . But I have used font in shortcode bulider. How can I print/enqueue this font?
Thanks
Try:
-
In
{theme}/framework-customizations/extensions/shortcodes/shortcodes/{shortcode}/static.phpglobal $_theme_fw_shortcodes_google_fonts; if (empty($_theme_fw_shortcodes_google_fonts)) $_theme_fw_shortcodes_google_fonts = array(); $_theme_fw_shortcodes_google_fonts['FONT_ID'] = array(/* font data */); -
In
{theme}/framework-customizations/extensions/shortcodes/hooks.phpadd_action('wp_enqueue_scripts', '_action_theme_fw_shortcodes_google_fonts', 9999); function _action_theme_fw_shortcodes_google_fonts() { global $_theme_fw_shortcodes_google_fonts; if (empty($_theme_fw_shortcodes_google_fonts)) return; // enqueue the fonts }
Thank you for reply. But I want it to be done within plugin. Is it possible?
It's not possible.
If you know a good, simple to use solution, please share.