Add Post Status to Body Class

You’ll have to use the body_class hook in the functions.php file of your theme in combination with get_post_status() function. Like the following: add_filter( ‘body_class’, ‘custom_class’ ); function custom_class( $classes ) { if ( get_post_status() == ‘rejected’ ) { $classes[] = ‘rejected’; } return $classes; }

Font Awesome wp_enqueue_style

Try this, function enqueue_load_fa() { wp_enqueue_style( ‘load-fa’, ‘https://use.fontawesome.com/releases/v5.5.0/css/all.css’ ); } add_action( ‘wp_enqueue_scripts’, ‘enqueue_load_fa’);

Different css rules for TinyMCE and Gutenberg while using add_editor_style()

SHORT VERSION Using css it’s possible to use of the :not() selector to exclude Tinymce instances, e.g. body:not(.mce-content-body) {…} LONG VERSION Let’s assume we have declared theme support for editor styles and included an editor stylesheet somewhere in our theme (e.g functions.php) like this: add_theme_support( ‘editor-styles’ ); add_editor_style( ‘something/something/css/editor.css’ ); For the sake of this … Read more

Twig + wordpress – how to get filemtime for style.css

You could simply use Twig’s date filter to append the current Unix timestamp via {{ ‘now’|date(‘U’) }} or {{ date().format(‘U’) }}. <link rel=”stylesheet” href=”https://wordpress.stackexchange.com/questions/333974/{{ site.theme.uri }}/dist/css/style.min.css?ver={{“now’|date(‘U’) }}” />

Change color of audio player depending on user role

The below will check the post creators role and based on that role allow you to set colour of the audio player. Created in a plugin so to stop theme updates removing it on updating functions file when updating theme. Not sure how to do this based on each comment of a person embedding a … Read more

How to Remove White Space above video Block

It’s a styling related issue so you should be more than capable to fix this issue with CSS. This should be easily accessible through the following steps in your /wp-admin/ environment: Appearance > Customize. Adding the following rule should solve your problem: .single article.has-embed { padding-top: 0; }

WordPress on localhost working, when sharing IP to connect receive err_connection_refused on .js and .css files

As discussed in comments, the problem was that the site address was set to localhost:8888/myBlog. This is the URL WordPress is expecting your clients to be using, and uses this to generate fully-qualified URLs for scripts and CSS etc. Hence your other clients were trying to load scripts and CSS from their own localhost. The … Read more

How to change the style.css?ver=5.4.1 in WordPress?

When you enqueue the style, you can use filemtime() as the version: <?php add_action(‘wp_enqueue_scripts’, ‘wpse_367594_enqueue_version’); function wpse_367594_enqueue_version() { wp_enqueue_style( // Update this to your slug. ‘style-slug’, // Update to your stylesheet URL if it’s not the main style.css. get_stylesheet_directory_uri() . ‘/style.css’, // Include dependencies here or pass an empty array. array(‘theme-dependency’), // Here’s the line … Read more

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