Working on the 2020 theme for my book, WordPress Themes In Depth, I noticed that WordPress was including a stylesheet from the Google API. Closer examination revealed that the styles were adding the Open Sans font via Google Fonts. The font itself is great, but I could not figure out where/how/why it was being added to the markup. This quick post explains what was happening and how to disable it.
This DigWP tutorial explains the "new" way to include parent stylesheets in Child Themes. I put the word "new" in quotes because the technique actually has been around for years, but there are many developers and designers who still use the old
@import way of adding parent styles. This tutorial is for people who may be unfamiliar with using WordPress’ enqueue functionality for Child Themes. Here you'll find copy-n-paste techniques, examples, caveats, and numerous resources. Basically everything you need to know about including styles in your Child Themes.
A cool trick you can do with WordPress is display information directly from your theme's
style.css stylesheet. I recently used this on a site where the theme's version number is used throughout the template to keep things current and consistent.
In otherwords, match what you see when creating/editing a Post or Page in the WordPress visual editor to what you get when you actually publish it. It's easier than you might think! Basically you can declare a special CSS file that the visual editor will use to render itself while you are editing it. If the styles in that CSS file match the styles in your live theme's CSS file, you are straight up WYSIWYG (What You See Is What You Get).
WordPress gives us full control over the presentation of our websites. We specify which classes and attributes to use in our template files, and then apply CSS using our theme’s custom stylesheet. Behind the scenes, WordPress generates its own classes and IDs, and applies them to specific HTML elements in theme files and database content. Having these default hooks available makes it super-easy to custom-style your theme’s blockquotes, post images, widget items, and much more.
I'm a HUGE fan of being able to link up a CSS file on a per-page basis. I just find it extremely common that a page needs CSS styling unique to it, and I hate litering a sites main stylesheet with customizations that only one particular page needs. We've talked about this before, and even created a custom method for doing so, as well as mentioned the art direction plugin, which makes this easily possible.
Most blogs display their content in single columns, but it’s also possible to display content in multiple columns. Multiple-column layouts are perfect for newspaper and magazine-style themes. Here are six ways of getting the job done.
The default output for WordPress’
post_class template tag includes class names for just about every type of page view imaginable:
By default, WordPress wraps HTML comments with paragraph tags:
WordPress also employs various template tags that may, in certain situations, result in empty HTML elements such as paragraphs tags: