Skip Navigation

[Resolved] Post layout template not displaying custom fields in the front end

This support ticket is created 6 years, 9 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by terryL 6 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#682773
Preview HL.png
Loan Data.png
Layout HL.png

I am trying to:
Display a custom post type Home Loans using a layout template - Template for Home Loans.
Link to a page where the issue can be seen:
hidden link
I expected to see:
The template showing the post in formation.
Instead, I got:
Only the post title is showing, not the other information of the post - hidden link

#683093

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Terry

That's odd. I took a look at your site and everything appears to be in order in terms of how you have set this up.

I'll need to do some further testing, and so I'm currently taking a copy of your site so that I can do that locally and pass it on to my colleagues if needs be.

I'll update you when I have some news.

#684580
2x Title.png

Hi Nigel,

One possible work around is to create a new template for that post type, which I did and it is working now.
Thou, this is not a good solution if many templates fails this way in future.

However, the new template created is having a small issue with the post title showing twice, can you help with this instead now?

Thanks.

#686530

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Terry

The title appears twice because it is output by your theme and you also include it in the Template Layout.

Template Layouts and Views Content Templates only take over rendering what is normally output by the_content() function in the theme template files. You are using the twentyseventeen theme, and you would need to edit the theme's template files if you want to remove certain other elements, such as the title.

I described this in more detail with another client, but using twentysixteen here: https://toolset.com/forums/topic/twentysixteen-theme-double-posts-in-layouts/#post-620580

Either create your templates bearing mind that the theme will output certain content which your Template Layouts don't need to, or edit the theme files as needed.

An alternative would be to switch to one of the simple recommended themes (OceanWP, Astra, or GeneratePress) which include theme options, where you can turn on/off things like the post title in options that become available in your Template Layout.

I'm not sure why the original template wasn't working, but if you have created a new one which is I would say you were unlucky with some unexpected behaviour and you shouldn't expect the same to happen again.

#691050

Hi Nigel, Thanks very much for your help.