Dev log
How to add /blog/ to WordPress post URLs
Put /blog/ in front of every post URL with a custom permalink structure. Keep custom post types out of it with with_front, and keep old links working.
3 min read
Dev log
How to add /blog/ to WordPress post URLs
Put /blog/ in front of every post URL with a custom permalink structure. Keep custom post types out of it with with_front, and keep old links working.
3 min read
Dev log
How to find the WordPress version of any site
Six ways to find which WordPress version a site runs, from the dashboard and WP-CLI to the page source and feed. Plus why hiding the version is not real security.
4 min read
Dev log
Manage WordPress with Composer
Install WordPress plugins and themes with Composer. I cover composer/installers, WPackagist, installer paths, autoloading your own code, and what to commit.
4 min read
Dev log
Run WordPress across local, staging and live environments
One codebase, three environments. I cover per-environment settings in wp-config.php, WP_ENVIRONMENT_TYPE, keeping secrets out of Git, and moving content.
4 min read
Dev log
Migrate a WordPress site from local to live
Move a WordPress site from your computer to a live server. Copy the files, move the database, fix URLs safely (serialized data included) and check everything.
4 min read
Dev log
Use WordPress functions outside WordPress, and the better options
Require wp-load.php to use WordPress functions in another PHP script. I also cover when SHORTINIT, the REST API or WP-CLI is the better tool.
5 min read
Dev log
Create and use a dynamic sidebar (widget area) in WordPress
Register a widget area with register_sidebar(), show it with dynamic_sidebar() inside is_active_sidebar(), and handle block widgets since WordPress 5.8.
4 min read
Dev log
Show one WordPress page’s content in another template
Pull one page's content into another template with get_post() and the_content filter, or setup_postdata() for template tags. I include a safe shortcode too.
4 min read
Dev log
Run a WordPress shortcode from PHP (and when not to)
Use do_shortcode() to run a shortcode in a PHP template, or call the function behind it when the shortcode is yours. Plus timing, escaping and [embed].
5 min read