Hallo
Ich habe eine customizer.php angelegt. In der php habe ich eine Funktion erstellt, wo nach ICH oder ein anderer User, die Farben der Link´s, Texte im customizer Bereich ändern kann.
customizer.php
PHP
<?php
function Ari_customize_register( $wp_customize ) {
$colors = array();
$colors[] = array(
'slug'=>'content_text_color',
'default' => '#333',
'label' => __('Content Text Color', 'Ari')
);
$colors[] = array(
'slug'=>'content_link_color',
'default' => '#88C34B',
'label' => __('Content Link Color', 'Ari')
);
foreach( $colors as $color ) {
$wp_customize->add_setting(
$color['slug'], array(
'default' => $color['default'],
'type' => 'option',
'capability' =>
'edit_theme_options'
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
$color['slug'],
array('label' => $color['label'],
'section' => 'colors',
'settings' => $color['slug'])
)
);
}
}
add_action( 'customize_register', 'Ari_customize_register' );
Alles anzeigen
In der functions.php wurde die php registriert sowie in der header.php.
functions.php
header.php
PHP
<?php // diesen Code direkt oberhalb des </head> Tags in die header.php einfügen
$content_text_color = get_option('content_text_color');
$content_link_color = get_option('content_link_color');
?>
<style>
#content { color: <?php echo $content_text_color; ?>; }
#content a { color: <?php echo $content_link_color; ?>; }
</style>
</head>
Die auswahl möglichkeiten der Farben ist vorhanden (Coustomiz). es werden jedoch nicht die änderungen angezeigt.
Hoffe auf diesem Wege eine Lösung zu finden.
Slipi