OK. Let’s see …

How do WordPress themes work?

When you are creating a website, basically you are using an HTML or PHP code to get a web browser to display your content. The traditional site building methods will require:

  • core HTML or PHP files to create the content itself
  • cascading style sheets (CSS files) used to tell the browser how that content should look
  • script files (Javascript, jQuery, etc) used to create interactivity and to add various different features to the given page

It means that every single page must be meticulously written to display the correct HTML, PHP, CSS, etc for everything to work properly. When you want to make some changes, each and every page must be modified individually. Which is boring and time consuming …

The content management systems have changed the situation creating a clear separation between style and content. The style is defined by templates while the content is stored in a database. As I already mentioned earlier, the final outcome visible on the front-end is nothing else, but a dynamic template populated with database entries.

What does it mean? It means that you can change how the content is displayed without actually touching the content itself. And this is the core operating principal of any content management system (WordPress, Drupal, Joomla, Magento, etc) and any WordPress component (themes, plugins, widgets, etc).

Long story short: a WordPress theme is nothing else, but a series of templates, style sheets, and scripts contained within a dedicated folder. When you add a new theme to your WordPress site, the given dedicated folder will be added to the default WordPress theme folder. These template files are included into a hierarchically organized structure (something called WordPress template hierarchy).

Whenever you perform a given action that will create a new database entry, WordPress will identify the corresponding template file in your theme folder in order to generate the proper visual outcome. For example, when you create a new post, WordPress will analyze the regular post template that is associated with your current theme, in order to build up the correct layout, to implement the included formatting rules, etc for your new post. If you choose to create a new sales page, WordPress will identify and use the page template … And so on …



Join the Discussion
Write something…
Recent messages
Firebrandone Premium
Are there any circumstances where by changing a theme wordpress could lose posts or are they backed up
Reply
smartketeer Premium
I haven't heard about such problems Brian.

Yes, is possible to have certain layout issues or display errors with a newly installed theme, but such problems can be automatically solved by switching back to the previous theme.
Reply
Firebrandone Premium
Should we backup content on our wordpress site to our own computer, thanks in advance
Reply
Firebrandone Premium
Thanks, will study
Reply
smartketeer Premium
My pleasure!
Reply
Holderbob Premium
What about choosing the best background for my theme?
Reply
smartketeer Premium
What is the question Robert?

You need to find a background image that fits your style. Is a simple choice and you are the only person who has the right to make that decision.
Reply
dowj01 Premium
I’ve certainly learnt a lot from this. Thank you.
Justin
Reply
smartketeer Premium
Glad to hear that Justin!
Reply
lesabre Premium
Thank you Zed
Reply
smartketeer Premium
Thank YOU!
Reply
AlanBenney Premium
great information many thanks for sharing
Reply
smartketeer Premium
Many thanks for reading!
Reply
Top