Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hi Hans,

    If I recall correctly, the template stuff is kind of particular for the “page” post type, out of the box with WordPress.

    However I have managed to implement a similar thing for a client site. Basically I created a select metabox that listed some specific custom templates, and saved the chosen one as post meta. Then on the template_include filter, I grab the post meta and locate the appropriate template file to load using the data.

    If you want, I can post the code, or at least most of it. Part did utilize https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/.

    Let me know and I can do what I can to help get some code going for you.

    Thread Starter Christian Rodríguez

    (@hanschristian)

    Hi Michael!

    Thank you so much for your fast answer.

    As I’m not well at coding, I find this a bit complicated for me (I cannot understand exactly how to use the code you posted from Github on my template).

    But looking for an alternative, I’ve found that we can use custom post templates in our custom post types in a very easy way:

    https://www.ads-software.com/support/topic/custom-templates-with-custom-post-type?replies=3#post-2850196

    I leave this solution here for further questions.

    Thanks anyway for helping and happy new year : )

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    That solution will definitely work, though it’s going to be a 1-1 relationship between individual post in the post type, to template. If that’s fine and works for you, then you have a solution going. If you needed a 1 template to many posts, you’d still need to get a bit more custom.

    However, hopefully this one works well enough.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Missing "Template" attribute’ is closed to new replies.