WP-Mix

A fresh mix of code snippets and tutorials

Category Archive: WordPress

Posts about WordPress

Page 12 of 17

View all WP query variables

Micro Tip for the day: slice of PHP code for viewing all WordPress query variables. Very useful for figuring out custom loops and such.

Maintenance mode via .htaccess

For WordPress users there are at least three great plugins that make maintenance mode just dead-simple. Even so, here is how to do it with .htaccess.

WordPress 404 email alerts

Here is a customized plug-n-play PHP script for reporting 404 errors via email. No editing required, just clean email alerts for each 404 error.

Create .po templates for WP themes via Poedit

Creating a .po template can be tricky using Poedit, but here are the exact steps that work for me.

Automatic versioning for enqueued stylesheets

Learn how to append the theme version, random number, or both as a query-string parameter to your CSS stylesheet URLs. This is useful for automatic versioning, cache-busting during development, or both.

Break Out of Frames for WordPress

Quick JavaScript snippet to prevent scrapers and turds from framing, defaming, and/or stealing your precious content..

WordPress Comment Anchor Links

Just a head’s up about comment anchor links: they tend to vary a lot from theme to theme, and whether or not there are comments on the post.

WordPress Load Order

Micro-post today, on the load order of WordPress..

Another WordPress Cron Example

Here is another WP Cron example for my previous article on WP Cron tips.

WordPress Cron Tips

Here are some quick tips for working with WordPress Cron. The trick to using the scheduling functions is to get the next scheduled cron using wp_next_scheduled().

Set attachment as featured image

Here’s how to set the first attachment as the featured image for posts in WordPress. This is useful for User Submitted Posts, which attaches uploaded images to each submitted post.

Disable or customize WP read more link

Quick snippet for customizing or disabling the WordPress “read more” link for the_excerpt().