get_theme_mod() has a second parameter where you can set the default value, the value to use if the option is not set.
So, if the default value is "1", you can use:
get_theme_mod( 'display_header_image_title', '1' )
Then, if there is not value for display_header_image_title (no value in database), "1" is used. So, you could check the exact value:
if( get_theme_mod( 'display_header_image_title', '1' ) === '1' ) {
}
Or just true/false:
if( get_theme_mod( 'display_header_image_title', '1' ) ) {
}
Related Posts:
- WordPress customizer: load controls in a custom div
- Customizer Show/Hide Logo and Site Title
- Get/Set wp.customize.previewer.previewUrl
- Customizer: Multiple CSS styles on same element in Live Preview
- make an array in wordpress cusmization api?
- Default Image not showing up in Customizer for WP_Customize_Cropped_Image_Control
- customizer live preview layout picker
- Pass media upload value to input field
- Remove Customize Background and Header from Appearance admin menu without CSS or JS
- Dynamically change feature image in customiser
- Where exactly do I write define( ‘WP_DEBUG’, true ) in wp-config file
- Integrating PHP into Javascript to display map markers with Google API
- Design view breaking on Pages
- Passing array in add_option()
- Display notification only once
- Using wp_localize_script to store the template url into a variable to use in JS
- Page Reloads Before AJAX Request Finishes
- Colorbox ajax loading of outside HTML content works perfect on localhost but not on server
- Ajax return code 400
- Pass PHP variable to JavaScript without inline JS
- Simple Plugin with custom javascript wont work – no console error
- Change the CSS of the Customizer API
- Button not refreshing page
- WP functions in .js
- How to prevent XSS alter custom global javascript object & methods in WordPress
- How to inject variables into public-facing JS using wp_enqueue_script
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- Ajax random number always the same
- Javascript file is not working on single.php wordpress [closed]
- Customizer: active_callback and sanitize_callback incompatibility?
- How to send Ajax request from my plugin in admin dashboard?
- How to register javascript variables in wp_localize_script?
- AJAX success response is not working but it’s saving my changes
- Post repeating with infinite scroll
- WordPress Ajax Call inserting data but success response false
- Add Codepen animation as Preloader to WordPress
- Making an AJAX call to refresh a table
- add onchange to select in a wp form
- WordPress Customizer Default Image
- load ajax using admin-ajax.php
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- Post repeated when opening in overlay, how do I solve this? [closed]
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- Load Javascript for a widget WordPress
- duplicate posts with ajax load more wordpress
- How to populate a Gutenberg select field SelectControl with option value from PHP array
- Send an e-mail on address with the link with disliked post
- How to extend SelectControl with data from my theme
- Show next image in array if page is revisited by same logged user
- Fetch Data from an external MSSQL Database in a Managed WP hosting
- Run do_shortcode on php template using JS function
- Using Google Analytics in an enqueued JS file
- Trying to add some custom text into WordPress Post title via function.php
- How do I disable cache for a certain page?
- How To Get HTML Eelement From Another Page
- Conditional Banners
- Update $wpdb query with AJAX
- $.ajax results in 403 forbidden
- AJAX to add to cart multiple products woocommerce
- Adding extra data to shortcode attributes and pass it to JS with wp_localize_script
- Filter portforlio with librairie isotop
- Replacing entire tag with shortcode – JavaScript [duplicate]
- How do I make comment-reply-button with that takes to comment reply form on click
- Allow user to choose header style
- Remove specific javascript when viewing page in Customizer?
- How can i get the same ajax result using WP REST API instead of admin-ajax?
- admin-ajax.php 400 bad request – whats wrong with my code?
- WordPress load javascript file if something… (after the page is loaded)
- Serve cookie free URLs in WordPress without using a CDN
- Make customizer panel or section button
- How to load WP_Editor JS files manually (with AJAX)?
- Force ‘permanent’ post cache of shortcode results
- Where to find the html for WordPress site? [closed]
- Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
- Replace content in WordPress Page after GET from php page
- Add title and caption to thumbnail image on mouseover
- How can I clear the theme mod settings?
- Cant get theme to change footer color through theme customizer
- Cannot get custom javascript to execute on page
- Echo piece of code from file
- How to create and add js and css file when server is not on my PC?
- Object of class WP_Post could not be converted to string while trying to console.log wp_get_nav_menu_items
- Check radio get value to array
- Require Credits Footer
- Adding jquery using php function
- How to hide .js files on wordpress website using php or wp plugins or any? [closed]
- notify users when changed database
- Import js variables loaded via wp_localize_script() into js module without global scope connection
- Having trouble customizing toolbar on wp_editor
- Load wp_editor on button click
- Remove Woocommerce product from cart with ajax/fetch
- WooCommerce Modal Fly cart on add to cart – With AJAX
- hiddenQuestions.find is not a function
- Weird Javascript:void(0) code in my website
- how to escape alert/window.location.replace with variable
- WordPress Customizer add_control Dropdown of Pages with Multi Select?
- How do I create a single.php file as the default template for single posts in the twentytwentythree theme?
- Registered a REST Route but I’m Getting a 400 Bad Request
- Add custom data attribute to every core Gutenberg Blocks
- How to inject right sidebar on post edit page?