try this code:
if( get_theme_mod('your_setting_name') ){
//your code
}else{
//your code
}
Note: get_theme_mod() return false if no value exist for your setting
Related Posts:
- Return a numerical function value in Customizer controls
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- Getting text from custom field from customizer
- Using get_theme_mod with checkbox to display content
- Cleaning up WordPress to improve performance?
- List of all theme customizer control types?
- Modify previous and next text from pagination links
- How can I modify the permalink via a filter?
- Shortcode putting html such as
- Calling a method from functions.php on a click of a button
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- How to change featured content to a different tag in WordPress Twenty Fourteen?
- Count Title and Post Characters
- Remove css styles from specific page
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- HTML table from shortcode with multiple parameters
- Show only IF not Google bot [closed]
- How the functions in WP are called in tags
- Differences when using the the_time and the_date functions
- Add a Second Menu to a theme that only support 1 menu
- Custom excerpt function re-factoring
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Displaying the Month and Year that a page was Created?
- Only Show Link If div Exists
- How to access global variable $menu inside a class function
- Change the WP Video Shortcode Output
- How to pick the default selected value in wordpress dropdown?
- Using WP-API and SSE not authenticating user ID
- Validate functions before inserting then into functions.php
- How to retrieve current wordpress profile page URL?
- WooCommerce: How can I get orders with a custom ID in order meta data object?
- Modify function to print tags/categories/exclude tags/categories/ number of posts
- Search not showing all results
- How to Reference/Echo Variable from Another PHP Function
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- How can I make an object available through the entire site?
- WordPress admin-ajax.php
- How do I modify the custom footer text and get theme version number to show in wordpress admin?
- How to use html inside a functions.php code?
- Nested “do” and “add” Actions is possible?
- Display Data in Table from External Database in WP using Shortcodes
- How to check if a Customizer setting is set?
- linking stylesheets and scripts with functions.php
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Remove item in Checkout
- How can I hook into the wp_mail function used by BackWPup?
- How to get current post category details inside “loop”?
- how to enqueque code in a php file from functions.php
- Only load certain artists on this page
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- Get the alt text of the image in a array
- Convert all uploaded PNG files to PNG-8 format
- Make table disappear when fields are left blank?
- How to Redirect Buddypress Directories To Login Page For Non Logged in Users
- Woocommerce order status payment
- How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
- Unzip file in functions.php, and add it to cron
- Add Block Before Entry Title Using PHP
- Display logged in user name and lastname on page
- How to Add a cutsom slug to my custom author role
- Dynamically populate parameter in Gravity Forms using PHP
- Store ajax data in PHP variable
- comment_post (if comment is approved OR $comment_approved === 1) not working?
- How to output the taxonomies that are assigned to each custom post?
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- How can i create a function tag in my plugin
- How to escape echo for input tag?
- Including user data in “new user notification email”
- Display current user metadata on WordPress page
- Reload page with a different shortcode when a user selects from a dropdown
- Refresh page after login with litespeed cache
- Return newly created category by code
- Woocommerce Add custom “Add to cart button” in single page with tags
- Hook into all password resets in WordPress and get password before hashing?
- Populate Posts based on category selected using AJAX that means without page refresh
- remove_action() not working in page template – Genesis
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- Can’t get_users info by using json_encode
- Dropdown menu on custom menu
- What is wrong in this code?
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Access preview settings in php
- WordPress get_post_meta issue
- Woocommerce Price Text
- Modify php code to pass a page id as a parameter in order to create a breadcrumb
- Show custom default avatar instead of gravatar
- Removing all my hardcoded URLs with get_site_url()
- WordPress 2014 Theme – Featured Content with multiple tags?
- Highlight main menu when on specific posts or pages
- ajax form function error
- Display custom meta box in my template file
- Woocommerce – Shipping tax class based on cart items not using the highest tax available
- How to display the date under the post title?
- Simple Probléme in wordpress
- Contact form with dynamic dropdown and filter
- Critical Error customiser
- Alternative to php echo within code
- Add multiple HTML attributes to an Elementor button
- hiddenQuestions.find is not a function