Answer the question
In order to leave comments, you need to log in
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
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'); // Цвет ссылок
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question