E
E
Eugene Chefranov2017-11-02 15:06:23
CMS
Eugene Chefranov, 2017-11-02 15:06:23

How do I set the initial settings for my WordPress theme?

I am developing a theme for Wordpress and in the theme I made it possible to customize some elements on the page using the customizer (adding text to blocks, setting up carousels on the main page, etc.), is it possible to make my custom settings already filled after installing the theme , texts (fish), and the user could change his data later?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene Chefranov, 2017-11-02
@Chefranov

I figured it out, I did it like this:

<?php 
    $base_color  = get_theme_mod('mycolor', '#507299'); // Основной цвет
    $add_color   = get_theme_mod('mycolor2', '#305075'); // Дополнительный цвет
    $links_color = get_theme_mod('linkcolor', '#305075'); // Цвет ссылок
?>

The second value of get_theme_mod is the default value

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question