Is there any way through the Theme Panel or via functions() in child theme to force a specific Post Template to be used when a post is in a Category?
If this is not possible, is there a way I can set the Post Template at the time I create the Post through the wordpress API? (https://developer.wordpress.org/rest-api/reference/posts/#create-a-post)
Thanks!
Hello @tdaplyn!
Unfortunately, with old-style templates, it is not possible to have different post templates per category.
But, you can have different single post cloud templates for your categories.
This is possible only with cloud templates.
We recommend to use cloud/PRO templates in order to have the possibility to edit them with the TagDiv Composer which contains a lot of functions and features, please check our tutorial here: https://forum.tagdiv.com/tagdiv-composer-tutorial/
Documentation here:
– https://forum.tagdiv.com/cloud-library-templates/
– https://forum.tagdiv.com/design-post-pages-using-cloud-library-templates/
– https://forum.tagdiv.com/cloud-library-category-templates/
Thank you!
<quote>you can have different single post cloud templates for your categories.</quote>
Thanks for getting back to me. Even with cloud templates I cannot see any option to set a default post template for a specific category. Could you point me to where that option is please? I have reviewed the documentation and cannot find it anywhere.
-
This reply was modified 3 years by
tdaplyn.
Hello @tdaplyn!
You need to use cloud templates instead of the default ones in order to achieve what you need. You can have different template for every post and category. You can access a post and assign another template: https://www.screencast.com/t/rk0VZfQWk6n. Please note that if you select a template as global, then it will apply on all the posts or categories. You can set a template for categories and posts in the theme panel -> categories also: https://www.screencast.com/t/HOSV7YmJ4N
Or you can duplicate a template and make it different. Check this topic: https://forum.tagdiv.com/topic/different-logo-in-categorypage/ ; Here I explained step by step how you can duplicate a template.
Thank you!
Hello @Bettina,
Sorry @tdaplyn for intercepting your conversation but we have a similar issue.
@Bettina I used your instructions on your last post https://prnt.sc/lIRSr8zaXrQK but Global post template remained as the category’s template https://prnt.sc/uEHZa0Cvp7oI
Can you help with this?
Regards,
Onisiforos
Hi @bettina and @StudentLife
Thanks for your help. After updating Newspaper and learning about cloud templates (brilliant!) I now have it working.
My posts are linked to multiple Categories so it didn’t work properly until I set the Primary Category on the post to the correct one, and then the post template was picked up from the theme settings just as I wanted. Perhaps this can help you as well @StudentLife?
Thanks again.
-
This reply was modified 3 years by
tdaplyn.
Hello @bettina,
Thanks for the update on this issue. Do you have an ETA on this issue as it affected the ux of our users on some case?
How do we do this?
“Please set the new cloud template in the theme panel too.”
@tdaplyn we use multiple categories as well, the correct ones are the primary but the system still refuses to show the correct template to that category.
Regards,
O
Hello Onisiforos!
Unfortunately, I have no ETA for the next update or when this issue will be fixed.
You can set it here for posts and categories: https://prnt.sc/PpjKTdDHWlaD
Thank you so much for understanding!
Hello @bettina,
Already did so as I mentioned earlier https://prnt.sc/lIRSr8zaXrQK but it does not work even though the article has primary the category I am showing.
Not really interested in the category cloud template to be honest as our categories do not have so many visits.
Regards,
O
Hello Onisiforos!
Strange! We need to investigate the issue further. Please contact us via email at contact@tagdiv.com and provide the following:
– admin url and credentials
– cpanel url and credentials
– a link to this topic in order to identify you
Thank you!