Simplify my font selection
-
Hi guys, I have a very simple font selector in my theme, but I feel it could be optimised using an array, but I really am struggling with getting the syntax correct and doubt I have come even close to achieving what I think is possible, can you help?
This is my sample code with 2 fonts:
if ( get_option( 'options_selectfontheadings' ) == "Aldrich") { wp_register_style( 'aldrich', get_template_directory_uri() . '/fonts/aldrich.css', array(), '20130904', 'all' ); } else { if ( get_option( 'mediafap_selectfontheadings' ) == "Actor") { wp_register_style( 'actor', get_template_directory_uri() . '/fonts/actor.css', array(), '20130904', 'all' ); } else { } }
Is it possible for those IF’s to be condensed into 1 array, so if ‘Actor’ font is chosen, it will load ‘actor.css’?
Would greatly appreciate any help here ??
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Simplify my font selection’ is closed to new replies.