Remove Emoji Support from WordPress 4.2

May 19, 2015 (8 years ago)
WordPress, JS, Functions

4.2 added the ability to use Emojicons in WP posts. If you don’t use them, you can remove the (unnecessary) scripts this adds to the header on all your site pages. Here’s the code for your functions.php file:

 Thank you, Paulund!

http://www.paulund.co.uk/disable-emojicons-introduced-in-wordpress-4-2

Allow Multiple User Emails

December 23, 2014 (8 years ago)
WordPress, Functions

Ever need to allow your users to have non-unique email addresses? (i.e. two user accounts with the same email address)

Here’s the function:

 

Manage Dashboard Columns

December 18, 2014 (8 years ago)
WordPress, Functions

In the latest versions of WordPress, the number of columns showing in the dashboard are automatically generated based on your screen size. That works for many situations, but you may want to control the number of columns.

For example, if  you only have 1 or 2 items showing on your dashboard, it looks awkward on a large screen. So, here is a function that allows you to control the default and max number of columns:

 

Allow HTML in Excerpts

December 9, 2014 (8 years ago)
WordPress, PHP, Functions

By default, WordPress strips all HTML tags from excerpts. To allow them, simply replace the filter that creates the excerpt from your content.

First, copy the default excerpt filter from wp-includes/formatting.php:

 By changing the strip_tags parameters, you can allow whatever tags you want:

Also be sure to change the name of the function. Copy this to your functions.php file.

 Then, replace the default filter with your new one in functions.php:

 

Replace “Howdy” in Admin Bar

October 20, 2014 (8 years ago)
WordPress, Functions

Use this function to replace “Howdy, $username” with “Welcome, $username”:

 Thanks to Thoriq Firdaus! Replayed from: http://www.hongkiat.com/blog/wordpress-howdy-customized/, where you’ll also find a clever function to customize the message for special occasions.

Custom Admin Page

July 1, 2014 (8 years ago)
WordPress, PHP, Functions

I use these for those occasions when I need to store specialized information in non-WordPress tables. (Such as orders in a custom shopping cart I built.)

It’s also handy for adding informational or instructional pages to the Dashboard.

This adds the page to the WP admin menu (put in your functions.php file):

 The page itself ( lt_orders.php ) resides in the theme folder, and is a simple PHP page, with any functionality you like. It doesn’t need any header or footer calls because it is rendered inside the admin.

Custom Logo on Login Page

July 1, 2014 (8 years ago)
WordPress, Functions

It’s a nice touch to customize for the client. We can also change the link to the site home page, and the title to the site name.

Put this in your functions.php file.

Check the path and name for your image, and make sure it’s no larger than 80px x 80px.

Front End Login Form

June 20, 2014 (8 years ago)
WordPress, PHP, Functions

So many times clients (and their members) want to login on the front end. Simple to add this in the header, or sidebar. Style as you wish.

Put this in your header template (or anywhere else you want the form to appear.)

 

Add a Custom Avatar

June 20, 2014 (8 years ago)
WordPress, Functions

So the client has a membership site, and wants to have a custom default avatar branded to their site, to replace the boring Mystery Man, or other strange concoctions:

Put this code in your functions.php file.

 Then create your image and upload the file to wp-content/themes/yourtheme/images/avatar.jpg (you can name it anything you want).

Remove Admin Items for Users

June 20, 2014 (8 years ago)
WordPress, Functions

This function allows you to hide critical admin pages from non-admin users. They will still be able to access the pages if they know the URL, but they will not appear in the admin menu.

 

« Previous - Next »

Skip to toolbar