I’m often asked where you should start. How can you move from copy/paste to being able to build anything in code? You want to build your new skills incrementally, step-by-step. Each time you copy and paste a snippet of code, stop and dissect it. Go through the individual instructions. Look them up. Take the opportunity explore the code you are putting into your project.
Let’s See the Differences
Let’s see the difference. You will explore what the different states are based on the settings in Settings > Reading. You will also learn the intent of these functions. The Posts Page is always going to set the is_home() to true. However, is_front_page state is determined by which page is assigned to be the front page, i.e. a static page or the Posts Post. Let’s see how this works.
Lab Introduction
In WordPress, these two functions can be confusing. They are identifying if the current web page request is for the front page or the Posts Page. Let’s get you setup and ready to do this simple lab. Just follow along with the instructions.
Enqueue the Stylesheet Resource
Step 2 is to enqueue the stylesheet resource. Google Fonts gives you what to enqueue. Where do you put this into your WordPress website? You will use the WordPress function wp_enqueue_style. Let’s talk about what this function does. What if you need to load up more than one Google Fonts? What is the syntax? You use the pipe | to separate out each of the font families. Let’s dig into the enqueuing and write the code for it. Don’t worry, as it’s very easy. You are actually writing PHP code here, even though it’s very little. It’s still PHP. Psst….here […]
Google Fonts and Your CSS
In this episode you will learn about how to work with the Google Fonts’ site, how to select the styles, and then what are the options they supply. Then you will work in Google Chrome Developer Tools to find where the insert the CSS. You will also see the result of when you forget to enqueue the resource, as the font is not loaded. Let’s get into the code as well as exploring the HTML and CSS tools available to you.
WordPress Event (Plugin API) Refresher
Genesis gives us the means to fully customize it because it utilizes the event system available from the WordPress Plugin API. Throughout the codebase, you unregister events to remove a component, register your callback to change something, or re-register an event to change its order or location. You need a solid understanding of the Event Registry system in order to customize Genesis. Let’s do a refresher here. You can accelerate your proficiency with the Plugin API using these video-based Docx as they thoroughly walk you through each construct: add_action remove_action add_filter remove_filter do_action apply_filters
The Intent of the Theme
What is the intent of the WordPress theme? What purpose does it serve? How is it different from plugins? A theme’s intent is to prepare and render out the HTML, i.e. content presentation. It handles the process of building what is needed to head out to the browser. In contrast, plugins are meant for extending or changing behavior and functionality. Features such as custom post types, taxonomies, widgets, shortcodes, etc. all go into a plugin. Plugins may even have their specific template files; however, styling is still a theme responsibility.
The Intent of HTML and its Markup
The intent of HTML is to provide structure and meaning for your content to be read by other software, such as the browser, screen readers, and web crawlers. While humans can read content even when it’s not well-formed, software needs a set of strict rules in order to parse it and do its work. Software is not intuitive and cannot read your mind or intent. It needs to be structure and a set of well-formed, strict guidelines. HTML provides this for us. The intent of markup is: to give you anchors for styling to give JavaScript anchors to traverse, target, […]
Web Page Sequence – in the Code
Next, let’s go into the actual WordPress Core, Genesis, and the child theme code. You will see the order (or sequence) in which files are loaded.
Web Page Sequence
Let’s do an overview of the web page, from its web request and back out to the browser. You will see the order (or sequence) of how the web request is processed, in a big picture view, including how the theme’s functions.php file and template are called.