Everything that happens in a theme: which template WordPress loads and why, enqueueing scripts and styles, menus and walkers, conditional tags, excerpts and content filters, and the CSS that holds it together.
Output JSON-LD schema markup for Article, BreadcrumbList, and FAQPage types on WordPress posts and pages using wp_head to earn rich results in Google Search.
A custom admin colour scheme with wp_admin_css_color() WordPress has eight admin colour schemes that every user can choose under Users → Profile. A plugin can add its own, for example in the client’s brand colours, which makes a white-label site feel like the client’s own tool and helps to tell a staging site from the…
WordPress 5.9 Full Site Editing: the structure of a block theme WordPress 5.9 (January 2022) made Full Site Editing stable. The block editor now edits not only the post content but the whole site: header, footer, archives, single post templates, the 404 page. In a block theme, PHP templates (header.php, single.php) are replaced by HTML…
Previous and next post links within the same category The default post navigation links to the previous and next post by date, across all categories. On a magazine with very different sections, a reader of a recipe gets a link to a football report. get_adjacent_post() and the navigation template tags accept “stay in the same…
Custom comment markup with a wp_list_comments() callback wp_list_comments() prints the comments of a post with WordPress’ default markup: an <li> per comment with the avatar, author, date and text in a fixed structure. A design with comment cards, a “3 days ago” date or a different order of elements needs its own markup. The callback…
date_query in WP_Query: filter posts by date range, weekday and modified date WP_Query has a date_query parameter that goes far beyond the simple year and monthnum arguments. It takes a list of date conditions joined with AND or OR, can compare single parts of a date (year, month, week, day, hour) or ranges (after and…
get_theme_mod() or get_option(): where to store settings WordPress has two places for settings. Theme mods (get_theme_mod(), set_theme_mod()) belong to the active theme and are stored together in one option per theme. Options (get_option(), update_option()) belong to the site and stay when the theme changes. Choosing the wrong one means settings that disappear after a theme…