WP-Mix

A fresh mix of code snippets and tutorials

Category Archive: WordPress

Posts about WordPress

Page 11 of 17

WordPress redirect logged in users

Nice WordPress snippet to redirect logged in users to any location. Also optionally redirect visitors who are not logged in to WordPress.

Remove ‘Private’ from private post titles

By default, WordPress prepends the string “Private: ” to all posts marked as “private”. Here’s a quick function to remove the private prefix and move on with your life.

WordPress: check if user is logged in

Here are some notes and examples of how to check if a user is logged in to WordPress.

WordPress get all user emails

Quick snippet to get all user emails in WordPress.

Members-only content via shortcode

Here is a sweet little WordPress shortcode to display content only to logged-in users. Visitors not logged in will see a custom message saying whatever you’d prefer.

Simple Ajax Chat .htaccess whitelist

In general, chat scripts are huge targets for malicious activity. My chat plugin, Simple Ajax Chat is no exception, and includes strong security measures to protect against attack. Aimed at the free version of SAC, this quick tutorial shows a simple Apache/.htaccess technique to further strengthen plugin security.

Display Images with User Submitted Posts

Here is a quick recipe for displaying linked images for images submitted with the User Submitted Posts plugin.

WordPress enqueue user-agent stylesheets

WordPress makes it clean and easy to enqueue custom stylesheets via the functions.php file. Here’s how to do it for user-agent stylesheets.

Get all meta data for WordPress user

Quick tip to get all meta data for any WordPress user. Warning, arrays ahead..

Shortcut to WP Login

Back in January of 2011, Chris Coyier posted a sweet .htaccess technique for setting up Simpler Login URLs in WordPress. This is a follow-up technique that’s slightly improved..

View all WP Post variables

Quick tip to view all WP Post variables, which can be useful for development and debugging in WordPress.

WP Admin link to All Options

The WordPress database houses more settings than those available in the Admin Area. Here’s a quick code snippet to display an “All Options” screen to view otherwise hidden data.