Create Simple WordPress Template

begin with create a folder in your wp-content/plugins/ folder called helloworld.
Next create a file in a text editor called helloword.php.
Add the following lines of code to the helloword.php file…
<?php
/*
Plugin Name: Hello World
Plugin URI: http://www.yourdomain.ca
Description: A simple Hello Word Plugin
Version: 1
Author: John Doe
Author URI: http://www.yourdomain.ca
*/
The above code creates the information pulled in to the Plugins page of your WordPress admin. Plugin URI should point to the site where you will provide updates and install details for a plugin. The other information above you can edit to be your own details.
Now add the following code to the bottom of the helloworld.php file…
function hello_world() {
Print(“Hello World”);
}
?>
The above code will output Hello World when the plugin is called from one of your pages. Upload the helloworld.php file to your helloworld folder and activate the Hello World plugin in your WordPress admin.
Last step is to add the plugin to a page so you can see the plugin. To do that add the following code to the bottom of your index.php file in your theme…
<?php
if(function_exists(‘hello_world’))
{
hello_world();
}
?>
6 سال پیش

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *

این سایت از اکیسمت برای کاهش هرزنامه استفاده می کند. بیاموزید که چگونه اطلاعات دیدگاه های شما پردازش می‌شوند.