WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 30 of 35

Triple Loop Navigation

Never thought this was possible, and still don’t know for sure because I haven’t had time to test this code sample found in a pastebin. Included here in its entirety for reference.

Site online but can’t access

Here are a few steps to take if a website is online but you are not able to access it.

Obscure template tags that rock

Here are my favorite “lesser-known” and perhaps even obscure template tags for WordPress:

CSS Style Placeholders

When displaying with HTML forms, most modern browsers display placeholder values for textarea and input fields. Once you’ve added placeholder attributes to your form fields, you can style their appearance via CSS.

772×250 vs 772×250

Just a heads up for Photoshop users exporting graphics for their WordPress plugin in the WP Plugin Directory.

Add Custom Info to PHP System Log

Here is a quick function for adding custom information to the system log via PHP.

Display external feeds in WordPress

WordPress makes it so easy to display external RSS feeds anywhere in your theme.

Private URLs with .htaccess

With WordPress and other publishing software, you can create “private” and “password-protected” posts, but the URL is still going to be discoverable via search engines and visitors. This technique using .htaccess makes the post and URL accessible only to the specified IP addresses.

Note about date and time

Just a quick note about how WordPress handles dates and times.

PHP Geo IP Lookup

Here is a nice PHP snippet for GeoIP lookups. As written the script uses api.hostip.info for the lookup service, but that is easily changed as needed (GeoIP lookup services change or go offline constantly). So for what it’s worth, figured it was worth sharing rather than complete and utter deletion. Yes I am a code […]

CSS Vertical Center Block

Here are two ways to vertically center a block-level element using CSS. The first method uses CSS flexbox, while the second method uses CSS transform.

Some Useful WordPress Shortcodes

Here is a nice collection of useful WordPress shortcodes, including cool functionality like displaying author lists, automatic links, subscribe links, current date, and more!