While working locally on a new site I realized that all of the image URLs were busted. Super happy to test out using the WP CLI search-replace feature for the first time to find out it works great! wp search-replace oldurl.com newurl.com Back in the old days I would use plugins like the Search and … Continue reading WordPress Database Search and Replace with WP CLI
Category: WordPress Tips
How to Add Meta Descriptions to WordPress Themes Using functions.php
While working on an SEO for WordPress course recently, I was looking for a way to manually add meta descriptions to a theme from the functions.php file. After playing around a bit, I came up with this solution: https://gist.github.com/zgordon/950159056d2ad299b0ee This of course raises the bigger question of why would you want to do this instead of … Continue reading How to Add Meta Descriptions to WordPress Themes Using functions.php
How to Get the ID of a Post or Page in WordPress
If you have ever needed to get the ID of a post or page in WordPress, just use the get_the_ID() function. It accepts no arguments and looks like this: <?php $ID = get_the_ID(); ?> You can also try this method: <?php global $post; echo $post->ID; ?>
How to Deregister, Unqueue and Unhook a Parent Theme CSS Stylesheet
There comes a time when working with a WordPress project where you want to not include certain CSS from a parent theme or plugin. For example, a parent theme may include extra stylesheets that you don't want or a plugin may be adding styles that conflict with your site. On a recent project, I wanted to remove … Continue reading How to Deregister, Unqueue and Unhook a Parent Theme CSS Stylesheet
Slides from WordCamp Chicago 2014 – Why Setting Up Themes is a Niche in Itself, What to Know
I'm excited to be speaking today at WordCamp Chicago on the topic of "Why Setting Up Themes is a Niche in Itself, What to Know" Please check out my slides below:
The difference between $wpdb->query vs. $wpdb->get_results in WordPress
This took me a while to figure out when I started intuitively using $wpdb->query to pull in results from a query in a custom table in WordPress. However, $wpdb->query only returns the count of the query. You have to use $wpdb->get_results to get the actual SELECT statement back. Good to know, and will save you … Continue reading The difference between $wpdb->query vs. $wpdb->get_results in WordPress
How to Load Conditional CSS The Right Way in WordPress
Big thanks to Micah Wood for his article showing how to load conditional stylesheets the right way via the functions.php file. Thanks Micah for the great post!
Let My Buddy Troy Dean Convince You To Raise Your Rates and Truly Value Yourself and Your Work
At WordCamp Phoenix earlier this year, Troy Dean, of WP Elevation appeared virtually to give an awesome talk on "101 Ways to Elevate Yourself And Demand Higher Fees."
If You Still Haven’t Protected Your Site from Pingback Denial of Service Attacks, Here’s How
A couple of weeks ago a number of sources started reporting on a WordPress security risk involving sites that had pingbacks enabled. If that involves you and you're still unaware of the issue, please check out this post from WP Tavern.
If You Haven’t Seen Brad Williams Speak in Person on WordPress Security, Watch This!
Brad Williams has long been considered a leading person on WordPress security. I've had the opportunity to see him speak a number of times and if you haven't, I would really suggest you check out one his latest talks from WordCamp Phoenix. I will be doing an upcoming course on WordPress security for Treehouse and … Continue reading If You Haven’t Seen Brad Williams Speak in Person on WordPress Security, Watch This!
