Skip Navigation

[Resolved] Single Custom post not displaying as same as a WP single post.

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.

This thread is resolved. Here is a description of the problem and solution.

Problem:
How do I create Custom templates for Custom posts, if I use only Types and can not use Content Templates or Layouts to style them?

Solution:
This is how you create Custom Templates for Types Post Types:
https://toolset.com/documentation/user-guides/creating-templates-for-single-custom-posts-in-php/

1. To create a template for the single posts of your custom post type, you need to create a file called single-post_type_name.php where post_type_name is the name of our custom post type.

2. then, you will style and code this template with Custom Code, here is more information on how you do this:
https://toolset.com/documentation/user-guides/displaying-wordpress-custom-fields/#1
https://developer.wordpress.org/reference/functions/get_template_part/

This support ticket is created 8 years ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 2 replies, has 2 voices.

Last updated by mayubonne 8 years ago.

Assisted by: Beda.

Author
Posts
#380491

I expected to see: display custom post created by Types as same structure as WP single post.

Instead, I got: to display the custom post by Types as same structure as custom post already created by Theme I chose, even though I created and added "single-'$your_slug'.php" into the theme. That is, the custom post by Types is read as same as the custom post created by the Theme.

I just add the "single-'$your_slug'.php" into the theme. Could you give me any ideas to resolve this problem?

Thank you very much in advance.

#380581

This is how you create Custom Templates for Types Post Types:
https://toolset.com/documentation/user-guides/creating-templates-for-single-custom-posts-in-php/

Or, you can use Views Content Templates to style them:
https://toolset.com/documentation/user-guides/view-templates/

You will need to use Custom PHP and HTML in your custom Post Type Template (in your theme) if you use the first approach.

Thank you

#390759

Hello,

It is eventually resolved that I create to write in WP post as it will be difficult for me to change the code in my theme.

Thank you.

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.