I wrote the article about how to design a category-specific page in WordPress here; but most of my friends had trouble while doing it. Actually, I explained the problems by thinking that wordpress does not know how to use query. But most of my friends had trouble doing it because they didn’t know it. Since this explanation is told in so many blogs, I think there is no need to explain it, but now I will touch on it lightly, I think there will be no problem. In the meantime, I will tell you the same way I used it through the same article. Some friends wanted me to share that page template, but I thought it was not necessary because I had to share it for some reasons, and it was too complicated for people who don’t know to query that file to use it anyway.
Now, without further ado, let’s get to work. First of all, we have a structure when listing the articles on the homepage with wordpress. Thanks to this structure, we create a loop and show the number of posts we want there, which I say for normal blog design.
How you say that structure is like this;
I’m telling you simply, because it can be used in different places depending on the css structure of each theme. That’s why I wanted to show it in the picture instead of explaining it through a theme file. You can use these codes differently, you can find how to make them on the wp codex site or on other blogs. When I have time, I will try to explain in more detail for now, I hope this will manage you
The code structure of the index page ;
As you can see, we showed the texts in the index within the if loop. But now, since we want to show only the article belonging to that category in the category, we will use the query post operation.
As you can see here, we took the posts of the 15th category and said that we would publish the 15th category’s articles. We wanted it to be listed as if this is the homepage of the site and there are only articles in category 15. And we made this list. The article content here and the article content structure in the index are not the same. For example, the css design on my homepage is different from the one for texts and the structure on the video page. Therefore, if you want to change the design, you need to edit it with css. I would say this is a bit of an advanced topic. Because you need to know the php structure a little bit. If you don’t know and want to do it, please make a backup.