Having trouble with my WordPress theme not recognizing my CSS file

My file path is displayed below:

D:\web server\blog.dev.cc\wp-content\themes\ablog\css
for java script file path
D:\web server\blog.dev.cc\wp-content\themes\ablog\assets\js

Despite checking the code multiple times, the issue remains unresolved. I am attempting to change the " to ' icon, however, it is not functioning correctly. I have also altered some paths in my CSS file and JavaScript files, but my CSS is not displaying as expected.

// steel sheet 
      function ablog_add_stylesheet() {
              // outer styles sheet 
         wp_enqueue_style('font-awesome.min.css', get_template_directory_uri() . '/css/font-awesome.min.css'); // font awesome
         wp_enqueue_style('elegent-icons.css', get_template_directory_uri() . '/css/elegent-icons.css' );// icon
         wp_enqueue_style('bootstrap.min.css', get_template_directory_uri() . '/css/bootstrap.min.css',array(), '4.2.1','all');// bootstrap css
         wp_enqueue_style('owl.carousel.css', get_template_directory_uri() . '/css/owl.carousel.css' ); // own file for slide css

            //own  CSS Files style.css 
        wp_enqueue_style( 'lookway_header_css', get_template_directory_uri() . '/style.css' ); // main theme css file
        wp_enqueue_style( 'lookway_header_css', get_template_directory_uri() . '/css/header.css' ); // header css
        wp_enqueue_style('themes.css', get_template_directory_uri() . '/css/themes.css'); // for artical
        wp_enqueue_style('responsive.css', get_template_directory_uri() . '/css/responsive.css' );  // responsive   
    }
    add_action( 'wp_enqueue_scripts', 'ablog_add_stylesheet' );


    // script

        function ablog_add_stylesheets() {
        wp_enqueue_script('modernizr-2.8.3.min.js', get_template_directory_uri() . '/assets/js/modernizr-2.8.3.min.js' ); // script 
        wp_enqueue_script('plugins.js', get_template_directory_uri() . '/assets/js/plugins.js'); // script 
        wp_enqueue_script('main.js', get_template_directory_uri() . '/assets/js/main.js'); // script 

    }
    add_action('wp_enqueue_scripts', 'ablog_add_stylesheets');

Upon adding the file, the CSS is not displaying correctly on my theme.

Answer №1

It is important to note that in the code, the same handle lookway_header_css is being used for two different styles. It is recommended to change this for better organization. To enqueue the style.css, you can utilize the following code:

wp_enqueue_style( 'theme-style', get_stylesheet_uri() );

Additionally, ensure that both wp_head() and wp_footer() are correctly called in the header.php and footer.php files.

Answer №2

Remember to include <?php wp_head(); ?> within the head section and <?php wp_footer(); ?> at the bottom of the body. Failure to do so will result in WordPress not knowing where to display scripts and styles.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it possible to alter .htaccess using the Wordpress Plugin API?

I'm looking to develop a custom WordPress plugin that involves modifying the .htaccess file. Can someone guide me on how to achieve this using PHP? I've seen it implemented in other plugins, but I'm unsure of the process. Any advice would be ...

Display specific posts on WordPress using their unique IDs

I'm facing a bit of a dilemma here - I really need to retrieve one or more posts solely based on their unique ID. Right now, my current code looks like this: <?php $post_id = 1; $queried_post = get_post($post_id); $content = $queried_post->post ...

I'm encountering an error when trying to return a value using the question mark operator in Vue.js - can someone explain why

When I attempted to retrieve the value using the question mark operator instead of using return twice, I encountered an error stating "Cannot read property 'omitDescription' of undefined." buttonText() { return this.omitDescription ? 'プ ...

After the initial iteration, the .length function ceases to function properly when

A validation method is set up to check the length of a user input field. It functions properly on the initial try, but does not update if I go back and modify the field. $("#user").blur(function () { if ($("#user").val().length < 3) { $("#userval ...

What is the best way to conduct automated tests on CSS rendering across various browsers, including Safari Mobile and the Android Browser?

Is there a way to programmatically and automatically test how CSS is rendered in various browsers, similar to how Selenium tests HTML and Javascript across different browsers? It would be great to integrate this with a BDD framework. ...

Retrieve the current font style with Kendo UI Editor

Recently, I've been facing some challenges while working with the Kendo UI Editor. Specifically, I'm struggling to retrieve the current font style. My goal is to use JavaScript or jQuery to obtain the following values: Values I am looking for: ...

What steps do I need to take in order to integrate my unique landing page design into Wordpress

Currently, I am involved in a project that utilizes Node.js on Docker. As part of this project, I have developed a landing page using Bootstrap. In the future stages of the project, our team plans to incorporate Wordpress as a content management system ( ...

unable to modify the content within a div by clicking on a link

Lately, I've been experimenting with a code snippet I found on this fiddle: http://jsfiddle.net/unbornink/LUKGt/. The goal is to change the content of a div when clicking on links to see if it will work on my website. However, no matter which link I c ...

Is there a way to change my cursor to a pointer finger when hovering over my box?

<script type="text/javascript"> function draw() { var canvas = document.getElementById('Background'); if (canvas.getContext) { var ctx = canvas.getContext('2d'); ctx.lineWidth = 0.4 ctx.strokeRect(15, 135, 240, 40) Is there a w ...

When hovering over the menu, the sub-menu is displayed and the content slides downwards. Is there a way to prevent the content from sliding down and have the sub-menu overlap the

When the main menu is hovered over, a sub-menu appears and the content below the main menu slides down. Check out the code snippet below: HTML: <div id="holderDiv"> <div id="menu"> <a href="#" id="items">Menu 1</a> < ...

Tips on displaying a div for a brief moment and then concealing it

Is it possible to create a div that will disappear after 10 seconds of the page loading using PHP or JavaScript? Here is an example of the code: <html> <head></head> <body> <div class="LOADING" id="LOADING" name="LOADING">&l ...

Accordion is having trouble expanding fully

My accordion is causing some trouble. When I try to open one section, both sections end up opening. I want it to toggle, so that only one section opens at a time based on my click. Switching the display from flex to column fixes the issue, but I don' ...

Leveraging IE conditional comments for including CSS or JavaScript files can lead to an increase in the number of HTTP

Our web designer has implemented special pages for Internet Explorer by using IE-specific comments. This means that certain stylesheets are only loaded if the user is using a specific version of IE: <!--[if lt IE 7]> <link type="text/css" rel="st ...

There are currently no articles found that match the search query

Recently, I started working with Django, but I am facing an issue with slug. Whenever I send a request to the Slug, I encounter an error. The error message I receive is: Articles matching query does not exist. Furthermore, I am facing another error while ...

Responsive design element order rearrangement

My code example is as follows: <div class="info-container"> <span class="item1">item1</span> <a class="item2" href="#">item2</a> <a class="item3" href="#">item3</a> </div> I want to rearran ...

Why does my text keep drifting towards the left edge?

After spending a day learning CSS and HTML, I decided to recreate a website from a YouTube video and add my own customizations. I was able to center the text in my introduction successfully. However, upon reviewing my progress (see screenshot here), it is ...

Issue with custom video plugin functionality on Internet Explorer browser

I designed a custom video plugin that allows me to use shortcodes for videos with a unique format. I implemented a code snippet from jsfiddle to create a prominent play button, which functions smoothly across all browsers except for Internet Explorer. Desp ...

Tips for creating a clickable title that directs to a URL

I am currently using the "Import All" WordPress plugin to bring in an Excel file containing numerous hyperlinks that point to specific Custom Post Types and a designated field. These hyperlinks are separated by commas from the corresponding title. For exam ...

Getting the location of a mouse click and adding tags (marks) on an image: a simple guide

Is there a way to incorporate images with tagged marks similar to Facebook's image tagging feature? How can I retrieve the X and Y coordinates of tags on the image itself (not the screen) and display them in a responsive manner? ...

Is a Responsive Split Layout the Solution for Your Web Design Needs?

I'm looking to create a webpage layout where the left half of the viewport is for Login and the right half is for Signup. This layout should be split side by side on tablets, desktops, and large screens, but stacked vertically (Login on top, Signup on ...