get_theme_mod not pulling updated value within Customizer without Publishing
-
In my theme, I have a Customizer section that has a particular value that gets set. In another Customizer section I’m checking that value, and providing options based on it. If I make a change in that first section and then Publish, the second section works as expected. But if I don’t publish first, I can’t find a way to pick up the change.
For example, say that get_theme_mod is currently returning a value of RED. I edit the theme in Customizer and change this value to BLUE without publishing, then go into my other Customizer section and it still shows the old value of RED. How can I get the updated setting prior to actually publishing this?
For what it’s worth, my functions.php file has these two customizer sections being loaded as follows:
require get_theme_file_path( 'inc/section_1.php' ); require get_theme_file_path( 'inc/section_2.php' );
- The topic ‘get_theme_mod not pulling updated value within Customizer without Publishing’ is closed to new replies.