Site icon Catch Themes

Programmatically change theme options in child theme

Hi everyone, new Catch Themes user here and I've just bought Catch Base Pro after evaluating the free version for a week. Very pleased with the overall simplicity and customisability. I would love to be able to change theme settings in a child theme's functions.php file instead of doing it in the theme customizer. I have done this with another theme (Hueman) but I can't work out how to do it in Catch Base. Why would I want to do this anyway? I like to create a child theme on my testing server, get everything set up with the right theme options defined in functions.php and then deploy the theme instantly on the live website without needing to set all the options in the WordPress dashboard/customiser. For example, I would like to set the featured content and slider to 'disabled' be default (but that's only one of many settings I would like to set the default for). I found the function catchbase_get_theme_options() which returns an array of all the theme option settings but couldn't work out a way of setting them. I also found the file inc/catchbase_default_options.php which I could use to set the theme defaults (but would not overide any changes actually made in the customiser) but modified versions of files in the child theme's inc/ folder don't seem to get applied - a general problem possibly? I will continue to experiment with my knowledge of PHP but lesser knowledge of Wordpress and child theme functions but any help would be appreciated. This isn't a show stopper right now but it would be great if I could create a function or something to change any setting in the child theme's functions.php. Mark.
Exit mobile version