My style.css isn’t being called/enqueued.

[ad_1]

Hey all. Been trying to make a WP site for a client and no matter how fancy the block editor is there are simply things that it can’t do and I need to bust out the CSS for. Problem is, the style.css just isn’t being called. I don’t understand how or why and I seem to be the only person in the world to have this problem and I’m reaching my wits end.

I’m using base Twenty Twenty-Three theme and I’ve nuked the whole site multiple times and tried it with different combos of plugins and ZERO plugins but either way this issue persists. I’m not able to FTP directly into the server so that has made things difficult.

I tried to download and run my own local WP and the issue was happening there as well. Eventually, after some digging, I found ways to make sure the style sheet gets enqueued in the functions.php. I added this code to my functions:

add_action( ‘wp_enqueue_scripts’, ‘mytheme_enqueue’ );
function mytheme_enqueue() {
wp_enqueue_style( ‘mytheme-main-styles’, get_stylesheet_uri() );
wp_enqueue_style( ‘mytheme-other-styles’, get_template_directory_uri() . ‘style.css’ );
}

And that fixed it! At least locally. After making my edits and building most of the site I tried to use All-In-One WP Migration plugin to move the site from local to the server. Apparently this migration didn’t take the functions script with it so I’m still having this issue. Is it possible to use the html blocks to call the style sheet in the header like you would in a normal website? Am I missing something incredibly obvious and dumb? I’m not able to escape this even when reinstalling everything and starting from zero.

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer