WordPress Structure
WordPress is a web template system that works with a template processor. This allows for the addition and use of various and specific functionalities for each theme, and you have the option to configure different themes to switch if you need.
But let us take a detailed look at what actually happens when WordPress and its components start working.
Themes
Themes enable users to change the appearance of a WordPress-based website without the need to modify the source code or the content of the site. Each WordPress installation requires the presence of at least one theme to ensure everything loads correctly. You should know that it is always preferable to have planned for a second theme, which is used as a back-up theme and serves as support in case your main theme stops working for one reason or another.
When creating a WordPress theme, it is necessary to comply with the requirements and rules for writing code, as well as with the structuring imposed by wordpress.org. The standards for a valid PHP and HTML code must be complied with, as well as for a correct CSS one. Each theme needs to contain the following files, which give its basics:
- style.css – compulsory for every theme. Style.css file controls the visual design and layout of the website pages
- index.php – default file that contains the loop of WordPress core
- header.php – the header part of the website pages. Everything begins with the header
- footer.php – the footer part of the website pages.
- functions.php – controls default and additional specific functionality
- archive.php – file used for displaying archives of the posts
- sidebar.php – file used to show sidebar/s if the theme needs one
- comments.php – file that contains all of the needed logic to pull comments from the database and show them in your theme.
- .htaccess – this is Apache server related configuration file that is used to specify how the server handles files from its root and subdirectories
Plugins
WordPress plugin architecture allows the substitution and extensibility of the functionalities of the website. A very crude statistic shows the availability of over 56,000 plugins that can help you achieve the desired configuration of yours website. They affect perhaps every area of action starting from the layout configuration and going through SEO, eCommerce, directory listings, private network management all the way up to complex systems requiring conditional logic.
The bright side of the plugins is that their installation and activation is done with 2 clicks of the mouse. Quick configuration follows, if it is included in the plugin management and you are ready to start working with your website. The difficulties come once you understand that the given plugin does not fully meet your desires or is no longer supported. This will require you to engage in code writing to add the desired functionality or action to the main functionality. If the plugin is no longer supported, this may compromise the security of your website and provide unwanted access to malevolent people.
If you wish to create your own plugin, you must first become acquainted with the WordPress hook system, which contains more than 320 hooks divided into two categories, Action hooks and Filter hooks.
The installation of a WordPress plugin is done through the WordPress administration panel, having previously copied the plugin via FTP to the WordPress plugin folder.
WordPress files and database
Once WordPress is installed on your server, the following happen:a bunch of files and folders are copied to the folder which you specified for the WordPress installationa database is generated
In the file structure, you will find configuration files that you are allowed to modify to set the system to work in a different way or to additionally increase its security. You can set different values, which must comply with the WordPress Codex.
It is good to know that it is undesirable to change the core WordPress files as it changes the logic and structure of WordPress. In case of an update of WordPress core, any changes made to the inappropriate files will be overwritten with the core ones offered by WordPress.org.
If you need more information about what can be done with WordPress, how to perform a specific action or you need to assign to us a project of yours, please contact us.