- Themes : Do we really need just two files?
- Themes vs Plugins
- Query Monitor Plugin
Themes in wordpress
After plugin, it is now time to learn about themes, unlike plugins themes do not add any extra functionality to WordPress but change how the site looks.
Having a good theme that matches with out site intention and goal is must for anyone creating site using WordPress. There are many free themes available but we can also choose to develop our own.
To start with theme development we need to create two files
It is not mandatory to keep all you styles and style.css, we can use other organized structure for that but like how in plugin we used the index.php header to let the WordPress know about our plugin, we use the style.css header for theme info
/*
Theme Name: Test Theme
Theme URI: tr.rt.gw
Author: Me
Author URI: me.com
Description: Testing theme
Version: 0.0.1
Requires at least: 5.0
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: test-theme
*/
I am using paimo chair theme for this site.
Theme vs Plugins
Themes are for representation of our site, its look etc. Plugins we use to add extra functionality.
We should never use themes to add critical features, always use plugins for that as the official docs suggest. Combined together theme and plugin can really make a very good site like the one we will be making in our course.
Query Monitor Plugin
Query monitor plugin is a developer tool we can use to see the database queries our wp site is making. We can use it for debugging our site.
Not only db queries it can show you PHP errors, API calls, ajax calls, scripts enqueued etc.
I found it very useful as on my own site, the script was not getting loaded and I couldn’t figure out why.
We can download the zip for plugin from here
“Our plugin needs a lot of rework to be done for it to become fully functional and deployable.”