If you are a WordPress developer, you may have used the WordPress hook
wp_add_inline_script() works, why it's better than either of the alternate inline methods, and how to support older (pre-4.5) versions of WordPress. Along the way, we'll look at some example code that you can customize and use in your own WordPress projects.
WordPress provides a widget that can be used to display recent posts in any sidebar or widgetized location. Likewise many WordPress themes provide some sort of "recent post" functionality, so users can display their latest posts in specific locations around the theme. Such functionality is great and useful for displaying recent posts just about anywhere in your theme. Problem is, those methods don't work for displaying recent posts inside of posts, pages, and custom post types. Like inside of post content itself. For that, we can use a shortcode.
One of the few regrets anyone can have in an online business is the failure to collect email addresses of their visitors. Simply put, the failure to have a list.
More often than not, you will hear people say, "the money is in the list" and that by itself is a statement of truth. Email list gets people coming back to your website, and by extension increases profit in business, because you are already dealing with a targeted audience.
Digging Into WordPress celebrates its 10th anniversary this month! Thank you to everyone who visits, shares, and contributes to DigWP.com — Cheers! :)
Previously we posted a list of available WordPress Developers & Designers. Lots of great people and companies shared their information, but a lot has changed since then. So rather than try to contact everyone on the list and ask them to update their infos, here is a new post of current WordPress developers & designers.
!is_admin()), or anywhere in the Admin Area EXCEPT the dashboard (e.g., via
get_current_screen()). It's just basic human decency.
Just to be crystal clear, this post is all about displaying basic statistics about your site, not about your visitors. So if you are thinking something like, "duh, just use Google Analytics or whatever," then imagine a giant buzzer sound telling you that you're incorrect. Sure, Google Analytics gives you information about your visitors, like how many, where from, how long, and so forth. But GA et al do NOT provide information about your site itself. Things like the number of registered users, number of posts and pages, number of comments, and all the other cool little details about your site. That is what we'll be covering in today's DigWP tutorial. So grab some popcorn and enjoy the show! ;)
Just a quick post to share some recommended useful resources for anyone working with the new Gutenberg Block Editor. Our book Digging Into WordPress now links to this post, so readers can learn more and dive deep into Gutenberg. Or just bookmark for future reference. What does that mean? It means that this page will be updated with any new useful and official resources. And by "official" just means the information is sourced/hosted at WordPress.org.
Previously, we covered numerous techniques to disable Gutenberg. For example, you can disable Gutenberg on specific post types, user roles, post IDs, and so forth. But what about doing the opposite and conditionally enabling Gutenberg? For example, if Gutenberg is disabled by default, you could then selectively enable it on whichever post types, user roles, or whatever criteria that's required. So this tutorial explains how to enable Gutenberg using simple WordPress filter hooks. You'll learn how to enable Gutenberg for any single posts, new posts, post meta, categories, tags, and post types. Plus some juicy tips and tricks along the way!
What up! Just to help spread the word about the DigWP newsletter. Get WordPress news, tips, and special offers delivered fresh to your inbox. 3-4 times per year max. Always good stuff, never spam, and we never share your info with anyone. Just a quality newsletter letting you know about awesome stuff happening in our corner of the WordPress universe.
Upgrading from older versions of WordPress is designed to go without a hitch, but depending on the setup and the two versions involved, you may encounter some hangups along the way. For example, if you are upgrading from a version of WordPress older than 3.0, eventually you may encounter the dreaded "Warning! WordPress Encrypts User Cookies" error. This quick DigWP tutorial explains what it is, why it happens, and how to fix the problem asap.
During the latest site redesign, I removed the Subscribe to Comments plugin. Wisely, the plugin does not delete any subscriber information from the database. So as a part of the site's redesign slash clean-up, I wanted to export/save and then delete all subscriber information to decrease overall database size. After searching and not finding any specific solution or preferred technique for this process, I rolled my own. Actually it's just a simple SQL query to get it done! :)