5 technologies involved in a WordPress site: HTML, CSS, JavaScript, PHP and MySQL ▸ We will be looking at 2 of these today: HTML and CSS ▸ HTML is the structure of your webpage, it contains and organizes your content. We won’t be changing this at all today. ▸ CSS is what tells the browser how to display the HTML, for instance which fonts and colors to use.
and properties to change the style ▸ HTML elements can have ids and classes: <main id="main" class=“site-main"></main> ▸ ids are for one element per page and classes for many elements ▸ Basic CSS applies styles based on tag names, ids, classes
many, many properties and features, all of which we can’t cover in 45 min ▸ Mozilla has a great reference for CSS and many other things at developer.mozilla.org ▸ Instead let’s jump into modifying a WordPress site to see how it works
create a new directory. In my example, I called this child-theme ▸ Then we need two files in that directory: style.css and functions.php ▸ In style.css, we need a theme name and a template (parent theme name)
// Let's add the parent theme's styles so in our style.css file we just add our modifications add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' ); function enqueue_parent_styles() { wp_enqueue_style( ‘parent-style', get_template_directory_uri().'/style.css' ); }
go to Appearance->Themes and activate our new theme ▸ It will look exactly the same as before, but now we can make all of our changes in our new style.css file ▸ Now let’s just work through some examples of how to make changes