Skip Navigation

[Resolved] can't remove from code – views-extra-css

This support ticket is created 4 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by antona-2 4 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1411471

<script type="text/javascript">jQuery( document ).ready( function( $ ) {
var extra_css = $( "#views-extra-css" ) ? $( "#views-extra-css" ).text() : null; if( extra_css ) { $( 'head' ).append( '<style>' + extra_css + '</style>' );
$( "#views-extra-css" ).remove(); }
if( $( "#views-extra-css-ie7" ).length > 0 ) { $( 'head' ).append( $( "#views-extra-css-ie7" ).html() );
$( "#views-extra-css-ie7" ).remove(); }});</script> <!--[if lte IE 8]> <script type="text/javascript">document.body.className = document.body.className.replace( /(^|\s)(no-)?customize-support(?=\s|$)/, '' ) + ' no-customize-support';</script> <![endif]--> <!--[if gte IE 9]><!--> <script type="text/javascript">(function() {
var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)');

request = true;

b[c] = b[c].replace( rcs, ' ' );
// The customizer requires postMessage and CORS (if the site is cross domain)
b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs;
}());</script>

How can I remove the output of this code from all pages of the site

#1412819

Hello,

There isn't such kind of built-in feature, you might consider custom codes, for example, add below PHP codes into your theme file "functions.php":

add_action( 'wp_loaded', function(){
	global $WP_Views;
	remove_action( 'wp_footer', array( $WP_Views, 'wpv_meta_html_extra_css_move_to_header' ), 21 );
});

More help:
https://developer.wordpress.org/reference/functions/remove_action/

#1412821

My issue is resolved now. Thank you!