How to add dynamic CSS to WordPress with wp_add_inline_style()
With wp_add_inline_style, you can add CSS dynamically based on any data, such as post/user/term meta or settings from wp_options.
Enqueue scripts and styles with automatic versioning
Versioning your CSS and JS means that you can improve page speed by leveraging caching and this method does it all automatically for you by using the time the file was last modified as the version number.
Creating custom sites with post types, taxonomies and meta
Thanks for attending my talk at WordCamp Tampa 2015. Once the video is up on wordpress.tv, I’ll post it here to supplement the slides and links below – in the meantime, I’ve got a simple video up on Vimeo for you to go along with. Helpful links from the presentation Putting things where they belong (building a functionality plugin) GenerateWP WordPress Developer Code Reference WordPress Codex register_post_type() register_taxonomy() Dashicons CMB2 (wiki) WP_Query Template Hierarchy get_post_meta()
Show prefix/suffix for posts in a certain category
This function allows you to show a suffix or prefix on the post title for posts in a certain category without actually editing the post title.
Managing projects in git with branches
This is my development workflow that I use for projects based in git. The idea is simple: branch everything and create branches for each of your hosting environments too.
Deploying your plugin to GitHub and WordPress.org simultaneously with great ease
Using a deployment script is the quickest and easiest way to get your plugin or theme deployed to GitHub and simultaneously to wordpress.org. And the best part? You don’t need to know anything about Subversion.
Pass YOURLS short links to Jetpack’s Publicize and Sharing modules
Using filters, you can pass your YOURLS shortlink to Jetpack’s Publicize and Sharing modules to get the most out of your YOURLS click stats
How to deactivate certain plugins on your development servers
There are certain plugins that you simply don’t want running on your local or staging sites, so this is how I manage systematically deactivating them.
How to run BuySellAds over SSL in WordPress
BuySellAds now supports SSL which means that you can upgrade your whole site to HTTPS even if you’re running BSA ad zones
A simple snippet to force SSL for your whole site
This snippet will help you if you want to force visitors to view your site over HTTPS (using SSL), even if they try to use HTTP.