According to Forbes Magazine, the WordPress website production tool is the internet’s leading platform for blogging. Its popularity is largely due to the simplicity of its installation and the flexibility to implement very diverse applications from the variety of visual (themes) and functional components (plugins) available.
Figures from the official WordPress site reveal that 31 percent of the internet uses this platform. Both small and large companies create a website or edit the old one by this means.
What is WordPress?
WordPress is a Content Management System (CMS) that allows you to organize information to create websites, blogs and even online stores. It is an Open Source service, that is, open to modifications.
It is mature and stable, initially publish in 2003 as a blog management tool, but its popularity grew to become one of the prefer CMS in the world, achieve by the wide portfolio of themes and plugins that facilitate its development.
Depending on how we configure WordPress, it can be classify:
- WordPress as Blog : this is the basic installation that allows us to create static pages, generate content and display it in lists.
- CMS : it differs from the previous one because a custom data structure is use for the creation of entries, that is, while the basic configuration has two fields (title and body), this would have more descriptive fields, for example , for a product you can have (label, size, etc).
- As a framework : it is a use that is given to WordPress, when the development is done only using the structure of the system, it is normally use to develop themes. Read: The world of apps: Web vs. Mobile phones
Previous knowledge
To work with WordPress, a lot of programming knowledge is not require, since with the use of templates and plugins, many customer needs can be cover. If you want to do more custom development, you need a knowledge of PHP and template-orient pages. Much of the information require to work with WordPress can be research and delve into in the WordPress documentation .
Some features:
- Quick Installation : offers different alternatives appropriate to the degree of knowledge of the user:
- Simple: the Auttomatic organization , owner of the WordPress product, allows you to directly create personalize blogs in the wordpress.com domain at no cost. In addition, it offers desktop tools and additional apps for spam control, centralize management of several sites and functionalities to facilitate content management.
- Intermediate : It is offer as an option in many hosting services. There are free options, where the user takes care of the installation and administration , as well as subscription options, where the management and optimization of the site is delegate to the service provider.
- Advance : it is possible to install WordPress on your own server (on a local or intranet network or on the web) by downloading installers according to the operating system to be use, Linux or Windows, which must be properly configure with PHP and MySQL (or MariaDB).
- The breadth of options both in the visual part (themes) and additional services (plugins), many of them free, and others at reasonable prices allow it to be apply in many different cases.
- It is open source , and this is one of the reasons why we are publishing this post, to give a brief introduction to WordPress, specifically what we must take into account to develop on this platform.
It is always recommend to include security plugins (for example: Anti-Malware Security and Brute-Force Firewall or Wordfence Security – Firewall & Malware Scan ) and off-site data backup.
What do I need to install WordPress?
- For your own server (with administration privileges) either local or on the web:
- The first thing is to have an environment install in which to run the application according to the operating system: XAMPP . This gives us a web server already configure to work with PHP and MYSQL on Windows or LAMP on GNU / Linux. It is also possible to use the NGINX web server configure with PHP.
- Create a database with a user with all the privileges and their respective password.
- We download the package from wordpress.org and save it in our local environment, taking XAMPP as an example, the path would be> xampp> htdocs.
- We open the path of our application in the browser and follow the steps of the installer.
- With this we will have WordPress ready to work.
- There are many domain hosting services, which include the installation of WordPress as an option, with a very simple interactive action.
- Directly host on wordpress.com, just create an account there and it is possible to have a platform for personal use.
WordPress is a product in continuous development, so it is extremely important to keep it up to date in terms of versions for stability and security. In addition, due to its popularity and high diffusion, it makes it attractive to cyber attacks. we are also providing full responsive WordPress Development Service in Lahore, You can also contact us.
Directory structure and control files
The following paths are for files or directories in which we may have to make modifications, the paths will be from the root of the files’ installation.
- ./wp-config.php: this is the main configuration file, in which we indicate what will be the connection data to our server and php configurations, take it into account when making a deployment or a change of environment.
- ./wp-content: this folder contains most of the changes that are made on WordPress. The ones that we will modify the most are mention below.
- themes: folder where all the configurations of templates, styles and functionalities associate with the themes are locate. In this directory there are individual folders for each of the topics to be consider on the site. Each of them includes a variable structure with specific files with images, javascript styles, and PHP.
- uploads: contains all the files that are upload through the administrator, important to take into account when assigning permissions.
- plugins: this folder is where both self-develop and external plugins will be add, it is very important to maintain this structure for the proper functioning of the site.
4. Make changes to a theme
4.1. Create child theme
To make changes to a theme, it is best to generate a child theme, this means that we will have a theme that ‘inherits’ all the functions and templates of the parent theme, this is necessary because if at any time you want to update the parent theme we would not lose the changes we have made.
For this, we create a new folder in the path of the themes, keep in mind that the name cannot have spaces or special characters.
Then we will create a file call style.css with the following content
/ * Theme Name: child_theme_name Theme URI: http://example.com/ Description: Child Theme Author: Author name URI: http://example.com Template: parent_theme_name Version: 1.0.0 Tags: tag1, tag2 Text Domain: child_theme_name * / @import url (“../ parent_theme_name / style.css”); / * = End of configuration ——————————————- ——————- * /
To take into account, when modifying the previous code:
- The uri will only fill up if necessary.
- It is very important to put the correct names, these are the same as the name of the folder that contains them.
- These lines can be copy base on the parent theme, the only one that cannot be found is the “@import url”. This should point to the path of the style.css file of the parent theme.
4.2. Change templates
To make modifications to the template, simply generate a file with the same name in the child theme folder, this will tell WordPress to use this template and not the parent theme.
You can also create custom templates within the child theme that are not in the parent theme, just follow the nomenclature when naming the files.
4.3. Add functions
The themes have a file call functions.php, in which all the custom functionalities that it will have are add.
When adding this file to our child theme, it will allow us to add our own functions, . it should be taken into account that WordPress prioritizes the functions.php file of the child theme over that of the parent theme, but it does not overwrite it but it will only take into account the modifications (add functions) of the child theme. This means that we must not copy all the functions of the parent theme for our theme to work.
5. Rest API
WordPress is configure to offer us a way to feed other applications with the content of our page.
This API provides the endpoints for the WordPress data types, . allowing to interact with remote sites through the sending of JSON, these will be available by adding to the url of our page / wp-json / wp / v2 /
We can also add the type of data we want to bring. Example: “/ wp-json / wp / v2 / posts”;