WP-Mix

A fresh mix of code snippets and tutorials

Category Archive: WordPress

Posts about WordPress

Page 6 of 17

WordPress oEmbed Tricks

Ahh yeah, here are some sweet little code snippets to customize the default WordPress oEmbed functionality. Techniques include modifying default oEmbed size, markup, as well as enabling oEmbed for Post Excerpts and Custom Fields.

WordPress Fix Image Upload Errors

Here are some quick tips to help troubleshoot and fix image and file upload errors in WordPress. Hopefully it helps someone out there get things back on track with their uploaded images. I know it can be frustrating!

WordPress Require User Login

This post shows a quick and easy way to require that the user is logged in to WordPress in order to gain access to some private content.

WordPress shortcodes for private content

I use these snippets all the time, so I’m posting them here at WP-Mix for easy access. The first shortcode can be used to display content only to logged-in users (based on capability). And the second shortcode can be used to display content only to visitors (non-logged-in users).

Video Tutorials: Securing WordPress Sites

After several months of production, my video course on developing secure WordPress sites is now available at LinkedIn/Lynda.com!

Include files from parent directory, subdirectory

This post concludes our trilogy of posts on getting file and directory path information with PHP and WordPress. In this final path-related post, you’ll get numerous ways to get and include files from parent directories, subdirectories, adjacent directories, and even the same directory, just to round things out.

Getting Path Info with PHP and WordPress

Massive round-up of PHP and WordPress techniques for getting various directory and file path information. This is a mega-reference aimed at PHP/WordPress developers.

WordPress configuration tricks

Some pipin’ hot WordPress configuration tricks for the wp-config.php file. All snippets strictly plug-&-play, no fiddling required. I use most of these on my own sites, so thought I would share ’em here at WP-Mix.

WordPress plugin redirect when settings saved

This technique is a bit esoteric and mostly for my own reference. Feel free to try the code if it makes sense to you; otherwise, maybe just move on to the next code snippet. Just not enough time in the day to explain everything.

WordPress Get the Author Outside Loop

This tutorial explains how to get the current Post Author outside of the WordPress Loop.

WordPress Disable Author Archives

This WordPress snippet disables all author-archive views. This may be useful to prevent user enumeration scans, and also may help to minimize duplicate content (for SEO purposes).

WordPress Get Recent Comments

In this tutorial, you’ll learn two ways to get the most recent comments on your WordPress-powered site. The first method uses get_comments(),and the second method uses the newer WP_Comment_Query class.