WP-Mix

A fresh mix of code snippets and tutorials

Category Archive: WordPress

Posts about WordPress

Page 1 of 17

WordPress: Get Current URL and Slug

Another essential tool for your WordPress development toolbox is getting the URL of the current page. This sounds simple but can be tricky depending on which page or type of page is being displayed. So to help, here is a simple technique to get the current URL for any single post, archive view, custom template, […]

WordPress: Simple Image Upload with jQuery

Some of my free WordPress plugins enable users to select and upload files from their local machine. The uploaded images are handled by WordPress and added to the Media Library. The technique is very basic and easy to implement, requiring only a few snippets added to your WordPress site.

WordPress: Customize Read More Links and Text

Here are two code snippets that are useful for customizing the “read more” link. The read more link is displayed on archive views like category archives, author archives, posts archives, search results, and so forth. You also will find the read more link displayed on the site’s homepage and on any page where posts excerpts […]

Responsive CSS for Simple Ajax Chat

Thank you to Benjamin S. for sharing this CSS snippet for my free WordPress plugin, Simple Ajax Chat. Simple Ajax Chat (SAC) provides a setting that makes it easy to add your own custom CSS/styles. So today we’re going to take advantage of that option to customize the appearance of the SAC chat box so […]

Over 300 SQL Code Snippets for WordPress

I’m excited to launch my latest book, Wizard’s SQL Recipes for WordPress. Years in the making, Wizard’s SQL Recipes brings together over 300 recipes for managing and optimizing the WordPress database. If you’re a WordPress administrator or developer who wants to level up their database skills, this book’s for you. Check out the PDF Demo […]

Free up screen space on EDD settings pages

Easy Digital Downloads recently added a giant logo to all of their settings pages in the WordPress Admin Area. That’s great for them, but users are left with about an inch less of screen space. So now when visiting EDD settings, customers, downloads, etc., you have less vertical space with which to work. This quick […]

WordPress: Display all comment fields when user is logged in

By default WordPress hides the Author/Name, Email, and URL fields on comment forms when the user is logged in. This is because WordPress automatically gets the related information directly from the user profile. But what if you need to do some testing or troubleshooting and want to display all the fields? Here is a plug-&-play […]

WordPress: Display All Registered Image Sizes

By default, WordPress generates extra images for each image that is uploaded via the Media Library. These extra images are created in different sizes and are used for different things, like featured images and so forth. In addition to the default generated images, other image sizes may be added via themes and plugins. For example, […]

WordPress: Get category slug on archive views

When working with WordPress, you can get the current post category using the function get_the_category(). That’s great but it works only on single posts and pages. This post explains how to get the category for archive views like date archives, category archives, search results, and so forth.

WordPress Display Plugin “View Details” Screen

Everyone is familiar with the WordPress Plugins screen. Where you can view all installed/active plugins, etc. On that screen, there is a link next to each plugin that says “View Details”. When you click it, a popup dialog overlays the page content. Inside of that dialog is a tabbed interface where you can learn about […]

WordPress Sidebar Template Code

When developing my free WordPress starter theme, I end up with lots of sweet code snippets that for whatever reason didn’t make the final cut. For example, the sidebar template was recently refactored with shiny new code. So what to do with the previous sidebar code? Delete it? Nah, instead I would rather share it […]

Disable Combined Scripts in the WordPress Admin Area

If you’ve ever tried to debug JavaScript or CSS for pages in the WordPress Admin Area, you know that it’s next to impossible to sort out which files contain which scripts. Why? Because WordPress combines them all at runtime into a single, concatenated script. It’s referred to as concatenation, and it helps to reduce the […]