WP-Mix

A fresh mix of code snippets and tutorials

Category Archive: WordPress

Posts about WordPress

Page 9 of 17

Display a Simple “Tweet This” Link

Twitter changes their API quite a bit, however it is still possible to display a simple “tweet this” link anywhere on your web pages.

WordPress Create Shortcode

Ultra-quick guide to help you create a WordPress Shortcode. Aimed at experienced WordPress users who need a basic example of how to create shortcodes.

WordPress Check PHP Version

When working with the WP API, you may need to check the current version of PHP to ensure compatibility.

Dealing with translation spam

How I respond to “translation spam”, which happens when greasy organizations ask permission to translate your script, extension, plugin, etc.

WordPress Set Featured Image with Fallback

In this tutorial, we’ll see how to enable theme support for Featured Images (aka Post Thumbnails), and also how to display them with fallback image support.

WordPress Do Stuff on First User Login

Here is a code snippet that runs the first time a user logs in to their registered account. Useful for sending custom welcome emails, or whatever.

WordPress Create Upload Files and Directories

This tutorial explains how to create new files and directories in the WordPress /uploads/ folder.

WordPress Allow HTML in Author Bio

By default, WordPress filters out any markup included in the description (bio) of user profiles. Here is a code snippet to allow HTML in author bios.

WordPress Check User Roles

Here is a plug-n-play function to check user roles, based on an array of input values.

WordPress wp-config.php tricks

A concise collection of wp-config.php tricks from my WordPress sites to yours.

Proper usage of get_search_query()

This tutorial explains the two ways to properly use WordPress’ template tag, get_search_query(), depending on context. Note that the information provided in this post also applies to the similar tag, the_search_query().

WordPress Conditional Shortcodes via Ajax

This example builds from the conditional do_shortcode technique to evaluate shortcodes during Ajax requests.