Skip Navigation

[Resolved] Created template for custom post type singles. Nothing is showing up.

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

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 5 replies, has 2 voices.

Last updated by Beda 6 years, 5 months ago.

Assisted by: Beda.

Author
Posts
#924496

I am trying to: Creating a template to display single instances of my custom post type.

Link to a page where the issue can be seen: will submit a page privately if necessary

I expected to see: All of my custom fields in a

<ul>

Instead, I got: Only the title of the post

Here is the code that's in the custom view i created for the "test" post type. When I view the post, it only displays the title of the post in an <h1> tag with a class of "entry-title". However, the <body> has a bunch of classes that indidcate it is in fact loading the right template. Here are the relevant <body> classes: "test-template-default single single-test".

Again, here's what I put in the view:

<h1>[types field='test_name'][/types]</h1>

<ul>
  
  <li>Vendor Category: [types field='vendor_category'][/types]</li>
  <li>Vendor: [types field='vendor'][/types]</li>
  <li>Vendor Contact Name: [types field='vendor_contact_name'][/types]</li>
  <li>Vendor Email Address: [types field='vendor_email_address'][/types]</li>
  <li>Vendor Phone Number: [types field='vendor_phone_number'][/types]</li>
  <li>Vendor Website: [types field='vendor_website'][/types]</li>
  <li>Additional Information: [types field='additional_information'][/types]</li>
  <li>Test Code: [types field='test_code'][/types]</li>
  <li>Test Name: [types field='test_name'][/types]</li>
  <li>CPT: [types field='cpt'][/types]</li>
  <li>Description: [types field='description'][/types]</li>
  <li>Segment: [types field='segment'][/types]</li>
  <li>Matrix: [types field='matrix'][/types]</li>
  <li>POC: [types field='poc'][/types]</li>
  <li>Cost:[types field='cost' format='FIELD_NAME: FIELD_VALUE'][/types]</li>
  <li>Shipping Cost: [types field='shipping_cost' format='FIELD_NAME: FIELD_VALUE'][/types]</li>
  <li>Suggested Retail: [types field='suggested_retail' format='FIELD_NAME: FIELD_VALUE'][/types]</li>
  <li>Patient Preparation: [types field='patient_preparation'][/types]</li>
  <li>Collection Instruction: [types field='collection_instruction'][/types]</li>
  <li>Specimen Stability: [types field='specimen_stability'][/types]</li>
  <li>Transportation Notes: [types field='transportation_notes'][/types]</li>
  <li>Aliases: [types field='aliases'][/types]</li>
  <li>Notes: [types field='notes'][/types]</li>
</ul>

Site is on a highly customized version of twentyseventeen built using Advanced Custom Fields.

#924644

I see you use a Child theme of Twentyseventeen

Can you please disable all non Toolset Plugins, and activate a original Twentyseventeen Theme?

Is the issue still present?
If not, you may be not declaring a compatible content function?
https://toolset.com/documentation/user-guides/editing-view-templates/theme-support-for-content-templates/

Otherwise I will need a copy of the site, if the issue still persist
Please exclude all other plugins from the copy, if possible.
https://toolset.com/faq/provide-supporters-copy-site/

#952803

I thought, I had replied to you already.

I did not, my apologies.

I believe I was unclear in my previous reply, because when I tried to deploy your package you sent me I was not even able to log in.
I needed to create a new user (edit an existing) in the database since there are no log in details and the security you use made it impossible to log in with my (too simple) password.
Even deleting those plugins by FTP, and resetting a much stronger password didn't let me log in.

So I suspect the steps I suggested where not possible to follow.

Please try this again with:
- disable all non Toolset Plugins, and activate a original Twentyseventeen Theme?
- Is the issue still present?
- If not, you may be not declaring a compatible content function?
https://toolset.com/documentation/user-guides/editing-view-templates/theme-support-for-content-templates/

Thanks!

#952805

changing state

#956613

Hi,

First of all, I apologize for not including a login in the package I sent over. I have zipped up another copy of the site, this time with a login for you.

Is there a way I can securely send you another copy of the site along with a login?

I have tried turning off all other plugins, to no avail. I feel like the solution is probably a simple one but I cannot figure it out myself.

Please let me know how to securely transmit another copy of the site to you.

Thanks for your help.

#957093

Yes, the solution is likely a simple one as outlined here:
https://toolset.com/forums/topic/created-template-for-custom-post-type-singles-nothing-is-showing-up/#post-952803 and https://toolset.com/forums/topic/created-template-for-custom-post-type-singles-nothing-is-showing-up/#post-924644.

I suggest to, if the steps do not help (disable all non Toolset Plugins, and activate a original Twentyseventeen Theme?) to check, if "you may be not declaring a compatible content function?"

Please refer to this DOC shared previously:
https://toolset.com/documentation/user-guides/editing-view-templates/theme-support-for-content-templates/

It states, that Toolset needs the_content() to render it's templates.
If you don't use it and only use Content Templates (not Layouts) you may use your own function.
But then you need to register it.

It is outlined in the linked DOC.

In case you tried that already at no avail, please use the next (private) reply to submit the data you prepared.

Thank you!