Jump to content

Archived

This topic is now archived and is closed to further replies.

ketri

How to select a different template for custom post type and it's child?

Recommended Posts

ketri

Hello,

When I select a page template for a custom post type page, it also selects the same template for the children of this custom post type. 
I want to have my custom post type template as a heavily customized loop that I've developed myself, and the children (they are articles) as a completely another template.

 

Is there a function that would allow me to select different templates for them on DMS?

Thank you very much in advance.

Share this post


Link to post
Share on other sites
Danny

Hi,

 

If these are custom post type pages then you should be able to assign different templates without any issue. Can you give us the exact steps as to how you have created your custom post type pages please.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
ketri

I downloaded the Custom Post Type UI -plugin and created one with it. 
Here is a screenshot of my settings for the custom post type: https://www.dropbox.com/s/ulmoe3wic09luhp/custom%20post%20type.png?dl=0

 

Can this get you started? Should I try another Custom Post Type plugin?

Also, is it possible to have a different template for custom post type -pages that have different categories?

 

Thanks in advance Danny!

Share this post


Link to post
Share on other sites
ketri

I tried creating a custom post type using Types and I'm running into the same issue. Whenever I change the template for parent or child, the other one changes also.

Share this post


Link to post
Share on other sites
ketri

Here's a 3-minute video where I install WordPress, apply DMS-theme, create a custom post type and try and set a different template:

https://www.youtube.com/watch?v=FPmv5e5PA8A

 

Cannot get it to work but you can see if I'm doing something wrong here.

 

Also I noticed that when editing pages there is a  "DMS page setup" -box where you can set a template. This isn't visible (probably it's not active) on the custom post type. I'd assume that this has to do with the DMS template -system?

 

Share this post


Link to post
Share on other sites
ketri

Monologue continues...

 

I found this post where you said:

 

 If my assumption is correct, you're attempting to have different templates load on different posts. If this is the case, then that is not possible in DMS, you can not have a different template loaded on a post by post basis. When you assign a template to post, it will be assigned to all posts of that post type. You can however, have a different template per post type, if you use custom post types.

 

Is this how it is or is there a difference with custom post type pages that are like posts and that act like pages?

Share this post


Link to post
Share on other sites
Danny

Yeah, you're correct. It would appear that when you create a child page they act very similar to a post where you're unable to have different templates on a per post basis. I will speak to our developers and see if this is something that can be addressed.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
ketri

Yeah, you're correct. It would appear that when you create a child page they act very similar to a post where you're unable to have different templates on a per post basis. I will speak to our developers and see if this is something that can be addressed.

Thanks Danny!

I'd expect this to have to do with the way DMS uses templates differently than themes where you have template-name.php's etc.

So If there is for example a function that adds the DMS-template functionality to pages, it would should track custom post types to see if they're like pages (hierarchical) and then let users use templates. 

 

Keep me updated!

Share this post


Link to post
Share on other sites

  • Similar Content

    • art23130
      By art23130+
      I have uploaded a file shoing missing sections for Custom Post Type
      It is OK for categories and tags but not for a single post types. 
      This is the link. 
      https://www.geoinformation.com/geocode_library/10-10570-rsg-2016-003/
      Any idea?
      thanks 
      Binder1.pdf
    • khat
      By khat+
      I think I may have installed pagelines pro incorrectly, and then used features incorrectly. I installed first platforms framework theme and then the child, thinking I could do setup for child later. I tried to set up a background image, and tried custom css feature in pagelines dashboard. I had mistakes in my css, and just thought that if I deleted the info in the css custom feature in pagelines dashboard that the new information would overwrite the old info. The background image didn't respond at all, probably because I didn't have the child directory renamed. I then tried to use the LSS plugin to create css and added more css, possibly, somewhere -sigh-. I never did change the background image and get it placed properly. I used a workaround and in nested containers I placed a background image which worked well enough, so I moved on to try to create my nav bar/ menu bar. When I go to the Menus panel, there is NO area where I can place a menu on a page. I have read and reread and re- re- reread the instructions for placing a menu. I've used the pagelines editor to place a menu, however only HOME shows up. I've been at this for many hours. I've since uninstalled all of my pagelines items and reinstalled, thinking that it would restore all my changes to default, but no, it is still all there, with all my unresolved issues. I am completely at a loss as to what to do next.
    • Jared Smith
      By Jared Smith+
      I haven't figured out how to get the "Sync Loaded Item" option in templates menu of Platform 5 to stay checked. It doesn't give me an option to save settings when I select it, and when I select it then click off the editor, it unselects. Also if I select it before loading a template, it doesn't stay checked there either.  Whats going on?
    • Queue-it
      By Queue-it+
      Hi,
      I created a Pagelines template for a "Post type" post. Whenever creating a new post page it firstly display that template post and I have to manually change it in the scope from "All of type posts " to "Current page". 
      Is there a way to fix that? 
       
       

    • richardjacruz
      By richardjacruz+
      I'm building a website in a dev environment at http://162.144.182.17/~uescocra.
      I want to import a bunch of products, and then have the products have a different template than the default template. 
      I also want to change the default template for blog posts.
      Before I go making changes, can I do this where the post type of "products" has its own global template, and the same with blog posts?
      For instance, in a product I might want to have a widget for categories, similar products, etc., and in the blog I may want list of the latest posts, blog categories, link to an email sign-up landing page, etc.
      Thanks.
      Rich
×