Skip to content

Instantly share code, notes, and snippets.

@AndreaBarghigiani
Created January 2, 2020 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreaBarghigiani/3a1a682a01baa7ca1b26e2d95fcbcdd8 to your computer and use it in GitHub Desktop.
Save AndreaBarghigiani/3a1a682a01baa7ca1b26e2d95fcbcdd8 to your computer and use it in GitHub Desktop.
Aggiungi tutti i Controlli che desideri al Theme Customizer: https://skillsandmore.org/aggiungi-controlli-theme-customizer/
<?php
//* Aggiungo la pagina d'esempio per i componenti
include_once( get_stylesheet_directory() . '/inc/theme-customizer/theme-customizer-demo.php' );
<?php
/**
* Register the breadcrumbs settings and controls.
*
* @since 2.1.0
*
* @param WP_Customize_Manager $wp_customize WP_Customize_Manager instance.
*/
private function breadcrumbs( $wp_customize ) {
$wp_customize->add_section(
'genesis_breadcrumbs',
array(
'title' => __( 'Breadcrumbs', 'genesis' ),
'priority' => '158.82',
)
);
$settings = array( ... );
$priority = 1;
foreach ( $settings as $setting => $label ) {
$wp_customize->add_setting( ... );
$wp_customize->add_control( ... );
$priority++;
}
}
<?php
function sam_breadcrumb_edit( $wp_customize ){
require_once dirname(__FILE__) . '/inc/theme-customizer/select/google-font-dropdown-custom-control.php';
$wp_customize->add_setting(
'google_font_setting',
array( 'default' => '', )
);
$wp_customize->add_control(
new Google_Font_Dropdown_Custom_Control(
$wp_customize,
'google_font_setting',
array(
'label' => 'Seleziona il font da Google',
'section' => 'genesis_breadcrumbs',
'settings' => 'google_font_setting',
'type' => 'select',
'priority' => 1
)
)
);
}
<?php
function sam_inserisco_css() {
?>
<style type="text/css">
.breadcrumb {
font-family: <?php echo get_theme_mod('google_font_setting', 'Arial'); ?>;
}
</style>
<?php
}
add_action( 'wp_head', 'sam_inserisco_css');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment