Custom Theme CSS Stopped Working
-
I’m trying to create a custom theme and everything was going as suspected until now. I’m using MAMP for my local environment and so far I only have the index, header, footer, functions and css files.
My initial styling worked fine but now I can’t make changes. It strange because I can comment out all of the styling and nothing changes, but if I comment out the wp_enqueue_style function I do lose the styling. It’s like I’m stuck with the styling I did up to this point.
This all starting happening after adding my custom logo.
here is my functions.php file
<?php // ADD CUSTOM STYLESHEETS function custom_theme_assets() { wp_enqueue_style('style', get_stylesheet_uri()); } add_action('wp_enqueue_scripts', 'custom_theme_assets'); // REGISTER PRIMARY MENU register_nav_menus(['primary' => __('Primary Menu')]); // Add CUSTOM LOGO function custom_logo_setup() { $defaults = array( 'height' => 100, 'width' => 400, 'flex-height' => true, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ), ); add_theme_support( 'custom-logo', $defaults ); } add_action( 'after_setup_theme', 'custom_logo_setup' );
Here is the code for adding the logo in my header file
<?php // maintain backward compatibility with the older versions of WordPress if ( function_exists( 'the_custom_logo' ) ) { the_custom_logo(); } ?>
I only give you this because the problem started after I worked on the logo. I tried removing this code but nothing changed.
- The topic ‘Custom Theme CSS Stopped Working’ is closed to new replies.