[Theme Customizr] Adding Google Fonts
-
Hi All,
I was hoping someone could help me with this as I would not be the best at coding and am missing one last piece to my problem. I would simply like to add the list of Google Fonts to the Theme Customizer to make changes to the header/body fonts easily.
I know how to create the feature with the Settings and Controls, I just cant get the list of fonts to pull through onto the site and am not sure where to even start really.
This is what I have so far for the Heading Font, but all that pulls through to the Theme Customizer at the moment is the drop down list for Heading Fonts and the options are: Array, Array, Array.
$wp_customize -> add_section( 'typography_options', array( 'title' => __( 'Typography Options', 'my_theme', 'my_theme-text-domain' ), 'description' => __('Modify Fonts','my_theme-text-domain'), 'priority' => 4 )); //Header Font $wp_customize->add_setting( 'heading_font', array( 'default' => 'none', 'type' => 'option', ) ); $wp_customize->add_control( 'heading_font', array( 'label' => __( 'Header Font', 'my_theme', 'my_theme-text-domain' ), 'section' => 'typography_options', 'settings' => 'heading_font', 'type' => 'select', 'choices' => array( 'arial' => array( 'label' => 'Arial' ), 'open-sans' => array( 'label' => 'Open Sans', 'google_font' => 'Open+Sans:400italic,700italic,400,700' ), 'pt-sans' => array( 'label' => 'PT Sans', 'google_font' => 'PT+Sans:400,700,400italic,700italic' ) ), ));
I hope this makes sense.
Thanks guys
Damien
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Theme Customizr] Adding Google Fonts’ is closed to new replies.