How to replace wordpress css or js file with external file?

From what I understood you want to override some particular CSS properties from style.css of a WordPress theme. There might be two different situations here which needs different solutions: If you are developing your own theme then you can simply edit your functions.php inside your theme files and add any JS or CSS file that … Read more

div:before appearing in front of the block

Despite the name, :before doesn’t actually set the layering position of elements, that’s set via z-index. To position your :before element behind the H1 text, you need to add z-index: -1; to the :before element, like so: .game-center-result .score h1:before { content: “”; position: absolute; display: block; width: 100%; height: 2px; background: #44454d; left: 0; … Read more

Custom CSS based on the Author of a Post

Welcome to Stack Exchange! In your theme’s function.php, you can add this code: add_filter(‘body_class’, function($classes) { $classes[] = ‘author-‘ . get_current_user_id(); return $classes; }); This will add a CSS class with the current author’s ID to <body> which you can then target: .author-2 .widget_bt_claim_widget { display: none; } See https://developer.wordpress.org/reference/functions/get_current_user_id/ for return values.

Default Gutenberg CSS on frontend

You can’t. There’s no stylesheet that exists that can be loaded on the front-end to make it match the editor exactly. Any such stylesheet would need to be created independently of the styles used in the actual editor, because the styles that are used in the editor are written to share scope with the default … Read more

Trying to hide the contact form on a particular page

If I understand correctly, you’re trying to turn off the ability for users to add new comments on a single blog post. Is that right? If so, instead of using CSS, I’d recommend using the built-in WordPress feature to turn off commenting for a single blog post. You’ll find it within the “Discussion” section when … Read more

Set version number in child’s style.css file

you can define the version when enqueuing the file : add_action(“wp_enqueue_scripts”, function () { wp_enqueue_style( “child-style” , get_stylesheet_uri() // = get_stylesheet_directory_uri() . “/style.css” , [“parent-style”] , wp_get_theme()->version // use the child theme version ); });