Skip to content

ThirteeNov

My personal blog about coding and internet

Menu
  • About me
  • About Zofia Kreasi
  • Cart
  • Checkout
  • Making an airplane game from scratch in Unity
  • My account
  • Privacy Policy
  • Privacy Policy – zkLeaderboard
  • Sample Page
  • Shop
  • Tutorials on Learning JavaScript
  • ZKAccounts – Privacy Policy
Menu

How to develop a WordPress plugin : Very Simple Way

Posted on February 15, 2021February 15, 2021 by Habibie

Basically making a WordPress plugin is very easy. If you know the basic, you can make it super complicated, depending on what you want to achieve.

First Step: Make the directory and plugin file

To make a plugin, simply create a directory inside wp-content->plugins folder of your WordPress installation directory. Then inside that directory, create your plugin directory, for example my-plugin. Go inside that folder and make the plugin php file, let’s say my-plugin.php file.

Second Step: Add plugin information

On the very top of your plugin php code, add basic information about your plugin. See this example below:

<?php

/*
 * Plugin Name: My Plugin
 * Description: Description about my new plugin will be here.
 * Version: 1.0.0
 * Author: Habibie
 * Author URI: https://webappdev.my.id/
 * License: GPL2
 * Requires at least: 2.9
 * Requires PHP: 5.2
 * Text Domain: my-plugin
 * Domain Path: /languages
 */

If you are planning to seriously develop a plugin, make sure your plugin slug (in this case “my-plugin”) is unique, so there must be no other plugin using same slug as yours.

In above example, make sure you replace “my-plugin” on each cases to your own slug. Obviously the plugin name too, description, etc.

Third Step: Code your plugin

Let’s just assume we are going to make a plugin to show an HTML text on our footer area of our WordPress website.

In this step, you need to do 2 things. First, make a PHP function to be called when WordPress is showing it’s footer on your website.

Let’s say we make this simple function:

//Showing Hello World text on WordPress footer
function helloworld_on_footer() {

	?>
	<div>
		<p>Hello World!</p>
	</div>
	<?php
}

Then the second thing, is to attach this function (to hook this function) to a WordPress action that you wish to use, in our case “wp_footer”, because we need to run that function on WordPress footer area. To do so, we need to do this:

add_action('wp_footer', 'helloworld_on_footer');

The second parameter on above line is the function that we made earlier.

Done!

Try to activate your plugin on your WordPress dashboard, and reload your website. You should be able to see your Hello World! text on footer area of your WordPress website.

Post Views: 468
ciihuy2020

Welcome!

  • My YouTube Channel
  • My GitHub Page
  • About me

Categories

  • 3DVista
  • Android
  • Apache
  • C#
  • Cordova
  • Electron & Node JS
  • HTML5, CSS & JavaScript
  • iOS
  • Let's Make Unity Games
  • Misc
  • Photoshop
  • PHP
  • Python
  • Uncategorized
  • Unity
  • WordPress

Recent Posts

  • Hover Reveal script for Unity to show and hide object on mouse hover
  • How to Prevent UI Clicks in Unity from “Bleeding Through” to 3D Objects Behind Them
  • Make objects like wires and cables easily in Unity using Ciihuy Curved Mesh
  • [SOLVED] Can’t Add Custom Domain to Blogger After Losing CNAME Verification
  • iOS App Icon Generator by CiihuyCom
© 2026 ThirteeNov | Powered by Superbs Personal Blog theme