Site Tools


onny:notizen:programmierung

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
onny:notizen:programmierung [2022/03/09 16:27] – [javascript] 46.223.162.30onny:notizen:programmierung [2022/03/10 17:30] – [wordpress] 185.52.247.41
Line 712: Line 712:
 <code php> <code php>
 <?php echo get_option('fachwerksauna_footer-text'); ?> <?php echo get_option('fachwerksauna_footer-text'); ?>
 +</code>
 +
 +customizer color chooser
 +<code php>
 +function theme_customize_register( $wp_customize ) {
 +
 +    $wp_customize->add_setting( 'theme_color', array(
 +        'default'   => '#ed9b40',
 +        'transport' => 'refresh',
 +      ) );
 +
 +    $wp_customize->add_control( new WP_Customize_Color_Control(
 +    $wp_customize, 'theme_color', array(
 +    'section' => 'colors',
 +    'label'   => esc_html__( 'Theme color', 'theme' ),
 +    ) ) );
 +
 +};
 +
 +function fachwerksauna_customize_css()
 +{
 +    $theme_color = get_theme_mod('theme_color', '#ed9b40');
 +    ?>
 +         <style type="text/css">
 +             :root {
 +                --themeColor: <?php echo $theme_color; ?>;
 +            }
 +         </style>
 +    <?php
 +}
 +
 +add_action( 'wp_head', 'fachwerksauna_customize_css');
 </code> </code>
 ===== sql ===== ===== sql =====
onny/notizen/programmierung.txt · Last modified: 2023/11/07 15:40 by 127.0.0.1