Try this function, why going through js when you can just do it with php inside your same file customizer.php
/*
** show site title or hide it
*/
function showtitle_slogan() {
$showttlslogan = get_theme_mod('display_site_title');
if ($showttlslogan == true) {
?>
<style type="text/css">
.site-title { display:none;}
</style>
<?php
}
}
add_action('wp_head', 'showtitle_slogan');
And do the same for everything else.
Related Posts:
- WordPress customizer: load controls in a custom div
- Get/Set wp.customize.previewer.previewUrl
- Customizer Show/Hide
- 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
- JqueryUi Dialog giving Uncaught TypeError: this._addClass is not a function error
- Dynamically change feature image in customiser
- Ajax template: how to handle head section
- Run shortcode at certain resolution
- Passing PHP Variables to JS using Localize Script
- Where exactly do I write define( ‘WP_DEBUG’, true ) in wp-config file
- Design view breaking on Pages
- Passing array in add_option()
- Using wp_localize_script to store the template url into a variable to use in JS
- How can I add tinymce editor in WordPress with jQuery?
- Slide in Panel WordPress Post
- Using shipped version of jquery
- Bridging TinyMCE js and WordPress PHP?
- Trying to implement Ajax comments in WordPress, getting WP error
- class click counter save number
- Getting array of customizer settings
- Ajax – Call to undefined function get_option()
- Populate dropdown with Child Pages based on Parent Page chosen
- Create a range slider to change font-size with different screens sizes in wordpress customizer api
- How to inject variables into public-facing JS using wp_enqueue_script
- Ajax random number always the same
- JS file work only in index page
- How to change redirection route to a php page for making it only accessible by logged-in members?
- Integrating PHP into Javascript to display map markers with Google API – problem with wp_localize
- How to pass Select value from Javascript to PHP to generate select option on change
- How does wp_enqueue_scripts work?
- Post repeating with infinite scroll
- WordPress Scripts Being Loaded in Footer
- Accessing WPDB Multidimensional JSON Array w/ Javascript
- wordpress wp_enqueue_script() not working
- Tell WP register script to load a script only when the entire page is loaded
- How do I get an external php page to load using javascript
- AJAX wp_insert_user WORKS but responds with “The site is not enabled”
- trying to put an active hover to my custom nav category buttons [closed]
- Can’t add script immediately after the opening tag on login page?
- Override user-edit.php to design own profile page
- Extending WP_Customize_Media_Control to return filename
- Incrementing PHP variable onclick to display posts by month
- JS file is not loading when i put wp_head() and wp_footer
- Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS
- How to add 3 weeks to the_time() function
- Replacing WordPress Icons (menu,icons32, etc)?
- Ajax URLs without #!, how to prevent falling into single.php on load or reload?
- How to sort posts by active category in WordPress?
- Additional file upload in Gutenberg page options/featured image
- Grabing default from cuztomizer php file instead of other php script
- Display WordPress search results based on the selected Sub-Category
- Variation prices breakdown only for single product page
- Woocommerce disable order item link (backend) [closed]
- Post form – AJAX won’t upload featured image – Plugin development
- Integrate admin plugin into template. Very interesant (live search + autocomplete with wp rest api, in vanilla js)
- How to add JS script in specific pages in WordPress?
- Load more posts using AJAX based on posts inside WP_Query
- How can i find wrong word in search box and replace with correct word
- How to use wp_ajax_set_post_thumbnail?
- Passing a value from an input field to a php function in WordPress?
- Display one random image from Media Library
- Google CSE Malfunctions via Chrome/Safari on Mobile When Clicking on Either Search Icon/Menu Icon. How to Make Google CSE Default Theme Search
- Using wp_editor() when not logged stopped working
- Modifying child theme’s header
- Show subcategory name selected in specific category woocoommerce
- I can’t load my images from a js file using wp_localize_script
- How to output values from a loop into a javascript array
- Move Jquery.js to Footer
- custom post type column countdown
- How to send Ajax Call from frontend without using wp_localize_script in Theme
- How can i iterate through this shortcode array?
- Multiple sections in Theme Customizer overwritten
- Sort on two variables
- Using get_theme_mod with checkbox to display content
- How to use Amazon Elastic Transcoder from WordPress using AWS SDK for PHP?
- Slider from different widgets
- add bootstrap modal after login in wordpress
- How to get values from wordpress listings and use them in javascript array?
- Help with my first Metabox helper class
- Trying to customize wordpress drop down categories
- Add multiple JavaScript files to template header [duplicate]
- Add specific phrase after every product title including the discounted price? [closed]
- link to page_for_posts
- Trouble figuring out how to get my button to submit comment
- Is there a better way to output HTML as a shortcode?
- Slick slider not working on wordpress
- Show Login Errors In WordPress/Elementor (Code “works”, but breaks site)
- How can I use AJAX in child theme template?
- Capture the Selected Radio Button Value between two files in wordpress theme
- Start a long running PHP process via JS/Ajax and monitor progress on admin page
- JQuery UI Autocomplete showing as bullets
- Partial refresh in WordPress live preview
- fetch php file from js script (Stripe Checkout) 403 Error
- Show the terms of the hierarchical taxonomy
- Add Imports to Existing WordPress Import Map
- Hide or Show Read More Button by Content Area