In the previous chapter, we started to create the structure of our plugin, made it more secure and finally created 2 pages for it on the admin panel. In this section, we will further develop our little plugin! If you haven’t read the previous chapter yet, you can find it here: https://link.medium.com/4Eh4o677Oub
What are we going to build
In this post, we will now create the next page, where the user will be able to enter the content of the meta tags, and our plugin will give suggestions regarding the optimal number of characters! This is how it will look like:
What are we waiting for? Let’s get into it!
How to customize the page
My basic concept for my plugin was that there would be a page where you could enter the different meta tags, and the plugin would give you ideas for implementing SEO optimization. On the other page, you can see SEO statistics. Now we will make the basis of the whole thing, so let’s start with the input fields, where the meta tags will go!
With this simple PHP trick, we will put HTML code on the page without using thousands of echo statements. My trick in this case is that where we insert the HTML code into the website, we close our PHP code (?> tag) and the HTML code can go underneath. When I’m done with the HTML part, I open the PHP code again. This may seem complicated at first, but let’s see how I solved the HTML insertion!
If you save the file and look at the plugin, our text will appear on one page, which means that my trick worked!
Do you remember that we specified a few parameters for the page navigation buttons? Well, if you call the name of the page as a function, it will affect the given page.
Input fields
Now that we have experienced how to insert text on the page, it’s time to make the input fields! We will use a simple HTML form for this!