• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

How To Create a Must Use Plugin For Your Custom Functions

This tutorial provides a simply beginners guide about how to create a plugin which automatically executes your custom functions.

This enables you to store all your custom PHP code in a plugin and use it when changing to any theme.

On top of this, all your custom functions are saved and not over written when your parent theme updates or in some cases, when your child theme is updated.

Here’s the step by step instructions about how to create your own custom functionality plugin:

1. Using a code editor like Notepad++, create a new file and add the following code:

2. Name the file something like custom-functions, save it as a PHP file and save it to your desktop.

3. Create a new folder in your wp-content directory named mu-plugins

4. Upload your custom-functions.php file to your new mu-plugins folder.

Now you can go to Plugins > Installed Plugins > Must-Use and you’ll see your plugin which is automatically activated.

mu plugin

You can then access your custom-functions.php file and add/remove/modify your custom PHP code using FTP.

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems