

#WP ENQUEUE STYLE CODE#
In the case of WordPress, we usually put all our custom styles inside the style.css file and our main Javascript code inside the main.js file Your own main stylesheet and script files that you write as a ninja frontend Developer.These are generally divided into two categories. Let’s deal with the scripts and stylesheets.Īfter the favicon, the next big thing that we have to deal with is our website stylesheets and scripts. Yeah! Right now, the file only contains an opening PHP tag.

This is my current functions.php file after removing everything from it except the opening PHP tag. Real code that goes inside the functions.php file starts from this module. I made you add them just for the sake of demonstrating action hooks. Now before we add our scripts and styles to the element, let’s clean up the functions.php file by removing everything that we added in the last part.
#WP ENQUEUE STYLE HOW TO#
In this part, We will learn how to load scripts and styles to our WordPress site. In Part 1: Developing a WordPress theme from scratch, we have learned about the foundations of the WordPress Theme Development. WordPress Theme Development: WordPress Customizer and it’s API.WordPress Theme Development: Search page, 404 error template, Custom Queries, and custom post types.WordPress Theme Development: Building the Blog.Building a WordPress Theme From Scratch: Internal Pages.WordPress Theme Development: The Loop, the main content, Google Fonts, and the Custom Fields.WordPress Theme Development: Site footer with social navigation, dynamic copyright statement.WordPress Theme Development: Creating the header and making our theme translation ready.WordPress Theme Development: The best way to enqueue scripts and styles(Current Part).Developing a WordPress Theme From Scratch.Here is the access to the other parts of the Course in the sequential order: This is Part 2 of the 9 part Course about developing a WordPress theme from scratch.
