Let’s create our own WordPress plugin with the fastest way – where we will use write our custom hack codes.
And i will give a link to this article in the next tutorials when we need to add new code from new article to be added to our website.
In WordPress Codex you can get how to create plugin, there are a lot of template strings which you should change. But actually we don’t need most of them,
To create your own simplest WordPress plugin you just need a single file and name in it.
- Create new file in wp-content/plugins folder.
- Put the single line
/* Plugin Name: My Custom Plugin */
to it - Go to wp-admin/plugins and activate the plugin “My Custom Plugin”.
That’s all with the creating.
But how will we use it for our own purposes?
Let’s add our first useful code and see how it works. In the future articles we will add more useful codes to this plugin.
Let’s add Google Analytics support to our WordPress website. For that we should add Google Analytics code to our website’s footer or header section. Let’s add to header section.
That’s all. With this simple code Google Analytics code will automatically be added to the all pages of our WordPress website.
Discover more from WP DEV - Elvin Haci
Subscribe to get the latest posts sent to your email.