WP-Mix

A fresh mix of code snippets and tutorials

Category Archive: WordPress

Posts about WordPress

Page 5 of 17

Disable extra p tags in WP shortcodes

When WordPress processes shortcodes, it first passes the content through its wpautop() function to convert line breaks to <p></p> or <br /> tags. This order of processing can lead to unwanted paragraph and breaks scattered throughout your shortcode content. This post provides a simple way to prevent this from happening, so you can keep your […]

WordPress db-error.php drop-in template

One of the more useful WordPress must-use plugins and drop-ins is the db-error.php file, which you can create, customize, and upload to your site’s /wp-content/ directory. Upon doing so, the contents of the file will be displayed whenever the database is unavailable. This post provides a simple template for db-error.php that you can customize and […]

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.

WordPress Image Gallery Loop

This post shares the custom-loop code referenced by the image gallery tutorial. Basically what we’re doing here is creating a custom loop for displaying images that are attached to the current post (i.e., in the WP Loop). This technique is used for the Responsive Image Gallery.

18 Sweet WordPress Functions

Here is a collection of 18 sweet WordPress functions that can be used to improve the functionality of any WordPress-powered site. Enjoy!

WordPress Random Post Class

Here is a simple plugin that you can use to include a random post class for each post. With a slight modification it can be used to include a random body class. This function can be useful for applying random colors and styles to your blog posts. Or whatever.

Get child or parent theme URI & path

These days, WordPress provides numerous ways to get the path and URI for the current theme directory. This post is reference for WP developers who need to get the URI and/or path for the current child or parent theme. Just grab, gulp, and go..

Allowed HTML tags for wp_kses()

Developing WordPress plugins, I frequently need to specify an array of allowed HTML tags and attributes for wp_kses(). The collection of allowed tags has grown over time, and so I’m posting it here at WP-Mix for future reference. Just makes my life easier, hopefully it helps you too.

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!

All WordPress Login Parameters

Here is a list of all the query string parameters used on the WordPress Login Page. Knowing these can be useful when you are customizing the Admin Area and related functionality, so you can be sure to cover all the bases.

WordPress use post modified time for better SEO

Quick collection of code snippets to help customize post dates to reflect most-recent-update information. I use this technique here at WP-Mix, DigWP, and elsewhere. Using the most recent date as the post date can boost the SEO value of your site.

WordPress add titles to post navigation links

In this post, we add title attributes to WordPress post-navigation links, for both previous/next archive navigation and previous/next single-post navigation. These are some simple copy/paste functions that you can add directly to your theme (or via plugin).