Add term of current custom post type to admin body class using admin_body_class

I think you’re missing get_current_screen(). add_filter( ‘admin_body_class’, ‘rw_admin_body_class’ ); function rw_admin_body_class( $classes ) { $screen = get_current_screen(); if ( ‘post’ != $screen->base ) { return $classes; } global $post; $terms = wp_get_post_terms( $post->ID, ‘product_cat’, array( ‘fields’ => ‘all’ ) ); $terms = wp_list_pluck( $terms, ‘slug’ ); foreach ( $terms as $term ) { $classes .= … Read more

Need to put a script above tag in header.php – WP 5.7.1

As @Buttered_Toest mentioned, this snippet works well. (This code goes to functions.php) function futy_widget_footer(){ ?> <script> window.Futy = { key: ‘0000000000’ }; (function (e, t) { var n = e.createElement(t); n.async = true; n.src=”https://v1.widget.futy.io/js/futy-widget.js”; var r = e.getElementsByTagName(t)[0]; r.parentNode.insertBefore(n, r); })(document, ‘script’); </script> <?php } add_action(‘wp_footer’,’futy_widget_footer’);

how to remove all body classes in wordpress

I’m going to assume you mean the classes generated by body_class(), e.g. from the twentytwentyone header.php: <body <?php body_class(); ?>> <?php wp_body_open(); ?> The simplest thing to do is to just remove the <?php body_class(); ?> call from your header.php. Or if you can’t / don’t want to change that, create a new header.php for … Read more

body_class REST field in WP-API

get_body_class() relies on $wp_query to do its thing, which is apparently a no-go for the JSON API. I considered creating a global object to hold the body class, and just using that to keep the body_class up to date…but that wouldn’t work without page reloads, and there would be no assurance that the object was … Read more

Append class to posts page

In your theme’s functions file, use the body_class filter to add new classes: function wpse_282694_body_class( $classes ) { if ( is_home() ) { $classes[] = ‘blog’; } return $classes; } add_filter( ‘body_class’, ‘wpse_282694_body_class’ ); If your category archives, tag archives, date archives and search results also need the same styling, which is fairly commin, check … Read more

Add content as soon starts

As every theme is different you can’t really expect a plugin to know where to put the slideshow in. As you say the best place would be the content filter if that’s where you want it. If you want it anywhere else you could inject it after using jquery?

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)