A thin line between native wordpress bahaviour and 3rd party themes

Bear with me as i try to learn WP.

Lets say we have a 3rd party theme were the route of the request is somehow like this.

Root theme index.php diverts to a nother php file which decides what page to go next depending on the themes settings.

then it gets diverted to a master page that handles all kind of pages (posts,pages,archives) using logic within this file.

And now Native WordPress comes and says for example that you can just create a category-{slug}.php file and use it.

It seems to work this way if i put a simple category-{slug}.php in my themes ROOT directory.

So is this how everything is working in WP? I can make a child theme for my paid theme and go inside and everything that codex says?

Maybe i am not well understood , but if someone "catches" my thinking , i would appreciate a shed of light.

Solutions

Do not rely on the codex. Some pages are just a heap of crap and totally useless. The problem with the codex is that everybody with an account on wordpress.org can change and alter the codex as they see fit.

I don't say, Do not use the codex, I'm saying that you need to be cautious. You need to read the codex in conjuction with the actual source code. Some pages are very well written and clear with many good examples of usage.

The way I read your question, you are hinting on the Template Hierarchy. This is one of the most important section as this is how Wordpress decides which template to serve up according to the URL been served. These templates are the recommended ones and any template naming convention outside this hierarchy won't work out of the box. Also, any naming convention that creates conflict with these set hierarchy will be ignored and will fail.

There are filters like template_include and single-template which will allow you to set a custom template which is outside normal hierarchy rules according to your needs. For example, if you need a custom template for the single posts of a specific category, you can create a file called single-cat.php and then use the single_template filter to tell Wordpress to use this template whenever a single post is from this specific category

EDIT

From comments, it is really easy to create any template in your theme. index.php can used as a base for any template. You just need to make a copy of index.php and rename it to what is needed

For eaxample, if your theme don't have a category.php, you can simply copy index.php and rename it to category.php

Similar questions

3rd Party Login in wordpress
I have two sites. One on wordpress and one non wordpress site. Now, I have used the header and footer from my non-wordpress site. What i want is that if user logs in on my non-wordpress site then he may use the same email and name to comment on my wordpress site. I get the user info from the non-wordpress site of the user via a CURL request. The ma...
WordPress Premium Plugin (3rd Party Github User)
I just started to setup my WordPress worklow with Composer. After hours of research I found a Github User, that is hosting "some" Premium Plugins on his Account. My Question's are:
How can I include 3rd party library in Wordpress?
I want to include this library on a single page. I'm pretty new to Wordpress, so I'm not sure how to do this. Is there a plugin which allows one to upload a library and then link to it in HTML of a page/post? I tried uploading the plugin contents to my wp-content/uploads directory, but I always get 404 errors when trying to link to the library file...
Including a 3rd party library in Wordpress which needs to be accessible by wp-config
I'm attempting to use the Defuse encryption library in Wordpress: https://github.com/defuse/php-encryption I'm using this guide as a resource for how to implement it: https://torquemag.io/2016/10/storing-encrypted-data-wordpress-database/ My question is, if my wp-config file requires access to a library, where should I put the library and require t...
Allow logged in WordPress user to access 3rd party Laravel API via OAuth
I have a unique situation that I'd love some help with if possible: My company manages a lot of WordPress sites. Each site has its own unique set of users (same users throughout all sites, but some only access X, others access Y, others both X&Y, etc). We use a custom SSO plugin to manage all that, with permissions and the like, which all works...
Authenticate user into wordpress via 3rd party system, both with the same domain
I'm trying to authenticate users from my system database into wordpress database. Both databases has the users records, since my registration form in https://domain.tld/office/register records users in both databases. I'm using woocommerce api to accomplish that, but this API has no mention how to log users in. I have 2 systems, both using the same...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.