lundi 5 octobre 2015

Apply template to custom post type

Today I got a client that wanted custom template for each page and section within. I proposed Laravel custom sh3t, but he wanted WordPress, as it seems more easy to main( not from my experience ).

.. So far so good. I'm a little confused there.

So I decided that my parent entity would be page, so I can apply different template to each page. Then I have a section within this page, which should be not hardcored. User should have the ability to choose section layout ( template ), and remove or reorder sections within the current page. And Finally I have posts as they are the smallest entity in the website. Posts would be rendered as columns like in bootstrap ( col-md-2, col-lg-6 ), etc..

I decided to create a custom post type to use it as a section, but then I read that post types cannot have template, only pages can have ones. This compromised my plan so far and spend 5 hours in researching a solution( no exit ). So I need another strategy for doing this. I need templates for two entities.

Can someone suggest a solution to this problem? ( I will buy you a beer! )



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire