Accueil » Coding » Divi » Customize easily your “Category” page

The Divi theme created by ElegantThemes is close to the no-fault; Nevertheless it misses one thing that his little brother inherited and that is the easy customization of the category page.
So with the Extra theme you can easily change the rendering and content of each page of our categories but there is no way to do it easily with Divi.

Starting from the code of Fabrice Esquirol which I thank in passing;), I wanted to relax the method allowing this personalization. For this I created for you a file “category.php“. I have prepared it for the most commonly used languages. That is to say :

  • English: the category that you wish to customize will have to be named “Category followed by the name of your category”,
  • French: the category that you wish to customize will have to be named “Catégorie followed by the name of your category”,
  • Spanish: the category that you wish to customize will have to be named “Categoria followed by the name of your category”,
  • Italian: the category that you wish to customize will have to be named “Categoria followed by the name of your category”,
  • German: the category that you wish to customize will have to be named “Kategorie followed by the name of your category”.

Now the procedure to be able to use it :)!

  • Place the file “category.php” in the folder of your child theme of Divi :).
  • Create a template with the name of an existing category in your site that you wish to customize with the following syntax. For the “Example” category, name your model “Category Example“.
    As WordPress will replace all special / accented characters and spaces, the slug of my model will become “category-example” (and it is this type of name that my file “category.php” will look for to know if a category must be customized 😉 …).
  • Customize your model as you like by adding all the elements you want. Don’t forget to add a blog module with the current category selected and a number of posts equal to or greater than the value entered in the “Number of Posts displayed on Category page” section of the Divi options, otherwise nothing will be shown for your category or you’ll get problem with the pagination 😀 !
  • I’ve added a new possibility. Define a template by default for all the categories 😀 ! For that, like for the categories that you wish to customize, add all the elements that you wish to see (don’t forget the “blog” module) and save your layout with the name “Category” (“Catégorie” in French, “Categoria” in Italian and Spanich, “Kategorie” in Deutch).
  • Thanks to Surya thanks to whom I discovered that the English used a specific version of WordPress (with encoding “en_GB”) and that allowed me to add this “peculiarity” to my file
  • Thanks to Gary Armstrong who allowed me to optimize the international aspect of the page category.php;)!
  • Appreciate the new rendering of your category 😀 !!

Click here to download the file “category.php” to place in the folder of your child theme of Divi.

Processing ...
USD

 

Information : Véritablement conquis par ce thème, je me suis inscrit sur le site de ElegantThemes en tant qu'affilié, ce qui signifie que si vous cliquez sur le lien ci-dessous et achetez le thème, je recevrai une commission :).

Information: Truly conquered by this theme, I registered on the site of ElegantThemes as an affiliate, which means that if you click on the link below and buy the theme I will receive a commission :).

 

Après avoir visité les coulisses, découvrez le site :) !

6 Comments

  1. Vi Mu

    Hi Pierre and thanks a lot for your solution but it doesn’t works in my case. I use the Divi blog extras plugin to set a different appearence to my blog entries and when I wanna set this appearence to the categories sections your code doesn’t works, if I try with the normal Blog module it works. Can you help me, please?

    Reply
    • Pierre

      Hi Vi mu :).

      Sorry but as I don’t know that plugin I really can’t help you with it and I’m afraid to not being able to adapt the script to every existing plugin ;)…
      I hope you’ll find a solution by yourself and you’ll come back here soon to share it with us :).

      Have a great day.

      Pierre.

      Reply
      • Vi Mu

        Hi Pierre and thanks for your reply,

        Definitely I can’t use Divi blog extras plugin for my purpose 🙁 Now I use your solution to show the same in every blog category but I wanna do the same with all the tags, is it possible with your solution?

        Thanks a lot!

        Reply
        • Pierre

          Hi Vi mu :).

          No. Sorry for that kind of functionnalities you should have a look on the Sean Barton plugins on Elegantmarketplace ;).
          I’m sure you’ll find what you need :).

          All the best.

          Pierre.

          Reply
  2. Paul

    Hi!
    Thanks a lot for this. It worked fine. But it doesn´t show any blogentries of the categories i´ve chosen. It only appears a “404 – Site not found” in the part, where I´ve inserted the “Blog module”. I´ve set the number of posts on 10 (Divi options is 6).
    Can you help me?

    Thanks!!

    Reply
    • Pierre

      Hi Paul :).

      Sorry but without any URL, I can’t see the problem and can’t help you with it ;)…

      Have a great day.

      Pierre.

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Accueil » Coding » Divi » Customize easily your “Category” page