You did not wrote if you want to check it using PHP or JavaScript but if using PHP you can add to your theme a below function it will return true if the page is previewed using Customizer
function is_customizer_preview() {
if( isset( $_GET['customize_theme'] ) ) {
return true;
} else {
return false;
}
}
Then somewhere in the theme template files you can use it like that if you want to have an additional class in the body
<body class="some-classes <?php if(is_customizer_preview()): ?>my-customizer-class<?php endif; ?>">
Related Posts:
- Color Picker (iris) in widget – refresh when edited in Customizer
- Access Customizer’s DOM – jQuery
- possible to make sections in theme customizer sortable and saveable at publish button clicked?
- $wp_customize customizer_preview_init not firing inside javascript
- Hide/show customizer controls based on other settings in Customizer
- trigger(‘change’) not working
- Using jQuery to retrieve customizer value
- WordPress customizer refresh screen after save
- Sorting widget control
- WP Customizer compare and set a value via javascript
- Callback After WordPress Customizer Complete Loading
- How to call custom jQuery plugins into the customizer controls
- WP Customizer: Save a control state
- Javascript when Customizer preview is ready/refreshed?
- Customizer add query to preview URL
- Retrieve customizer value using ajax or customizer api and print the value in theme
- How to add input file plain text and submit to publish?
- My javascript is returning this error: $.ajax is not a function
- Bootstrap – Uncaught TypeError: Cannot read property ‘fn’ of undefined
- Invalid or unexpected token on a very simple function
- How to get a cross-origin resource sharing (CORS) post request working
- Adding a page loader using jQuery
- jquery – return value using ajax result on success
- onclick event pass
- id or value
- Can you detect “dragging” in jQuery?
- Twitter Bootstrap Modal Form Submit
- How to overwrite a JavaScript core function?
- Automatically decrease font size for long words
- Custom function to rearrange attachments when creating posts – Almost there
- jQuery and AJAX Not working with Select Form Element
- Horizontal scroller with post_thumbnail’s
- Force wp_enqueue_scripts to the HEADER?
- How to Change CSS Variable value in Theme Customizer Live Preview
- Disable collapse of admin meta boxes
- jQuery code not firing on page despite registering and enqueuing scripts
- Ajax pagination works only first and third time
- How to properly add Bootstrap and JQuery Javascripts?
- how can I make $ work in wordpress for jQuery?
- WordPress Jquery Fade in, Fade out effect
- How to use Bootstrap with WP’s jQuery? [closed]
- Gutenberg Filtering Metaboxes by Post Format
- WordPress site in China times out on requests to youtube [closed]
- No data received
- show element on page load from external url only [closed]
- CodeMirror on Custom Widget Textarea
- Sending click events to Google Analytics in WordPress: the easy way
- Accordion scrolls page too low after clicking on the title [closed]
- Exclude some scripts from removing unique scripts from head function
- Passing jQuery into the WordPress media uploader
- jQuery undefined function error with WP jQuery, but works with Google CDN
- Simple text and image slider
- Why does my jQuery AJAX return 0?
- jQuery script is not working inside ‘head’ tag
- Why doesn’t jQuery use $, and how can I get it do so (GLOBALLY)?
- How do I include javascript/jquery image resizing with wordpress?
- Title on hovering on the featured image
- Loading a newer version of jQuery within WordPress
- WordPress 3.1 makes my drop down menu dissapear, jquery dont work
- Having trouble setting / modifying cookies
- Loading dynamic content with AJAX breaking jQuery
- Adding JavaScript file in Admin Panel
- How do I use jQuery to add the TinyMCE WYSIWYG editor to a textarea?
- why is my wordpress Jquery-Ajax call not working?
- Unable to get my javascript to work on my website – what am I doing wrong?
- Using jquery with wordpress using wp_enqueue_scripts
- get value from selected input
- jQuery script doesn’t work on WordPress
- Contact form 7 issue with jquery – hiding/showing fields [duplicate]
- Multiple Media uploader output to input
- Can’t add classes using jQuery from a JSON string with get_body_class()
- Ajax call through admin-ajax.php returns 404 error
- Why does deregistering jQuery cause other scripts not to load?
- How to add external remote JS source to Gravity Forms?
- inner jQuery won’t work
- Insert a Featured Video
- wordpress file upload from direct directory not working
- Gutenberg Gallery Block – How to get the full image url in Javascript/jQuery?
- Override parent theme deregister
- jQuery Validation plugin and Bootstrap 4 CSS classes
- bundled jquery in theme js not working with wp_localize_script
- How to toggle custom WP archive list
- I can’t enqueue Suggest.js in frontend – not added
- Jquery code won’t run loaded from WP, but run from console
- JQuery is not defined but jquery script is loaded in source [closed]
- owl carousel not working after ajax load [duplicate]
- jQuery post method in admin menu
- jquery not working correctly in plugin options page?
- jQuery AJAX add json2 dependency?
- Running javascript in a child theme. Works in jsfiddle
- How to block action if post is “dirty”?
- $ not defined using jQuery in WordPress
- How to read the contents of single post through RSS feed
- jQuery Ajax / Modal admin event not firing since 3.6. Seems to not recognize “a” tag
- Auto Select Child categories on Multiple Dropdown – Jquery
- WordPress video end function [duplicate]
- jQuery Live Form Validation in WordPress
- bootstrap-slider.js by seiyria not working in wordpress
- Sliders with buttons [closed]
- jQuery datepicker not showing on admin menu
- Can’t seem to check off a category checkbox with jquery?