Skip Navigation

[Resolved] I have a template for posts setup. 5 fields. front end only shows 2.

This support ticket is created 7 years, 3 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+01:00)

This topic contains 13 replies, has 2 voices.

Last updated by Nigel 7 years, 3 months ago.

Assisted by: Nigel.

Author
Posts
#541150
fot_ts_2.JPG
for_ts_1.JPG

posts are set up to display 5 fields. When toolset is used as template only 2 fields show up on front-end. If toolset is disabled and WS default template is used all fields show up. As you can see in the picture, 6 fields are defined. In the front-end picture of the fields, only title and image show up.

#541153

BTW, site is claremont.today/wp

#541414

Nigel
Supporter

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

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

Hi Terrance

A couple of things. First, since Layouts 2.0.1 the Divi integration plugin is redundant and you can remove it. I'm not sure why you are using it as you don't appear to be using the Divi theme, but in any case it can be removed.

In your question you say "If toolset is disabled and WS default template is used all fields show up". What's the WS default template you refer to?

Just to be clear, you are customising standard WP posts rather than a custom post type, yes? And you have created custom fields with Types which you have assigned to standard posts and populated with data?

Can you switch to a standard theme like twentyseventeen and see whether the fields are output by your Layout?

#541501
fot_ts_4.JPG
fot_ts_3.JPG

What I's saying is that in Dashboard if I assign a "Template for Pages", made with the custom fields as you can see in the picture provided, the individual posts pages and blog pages show only two of the assigned fields. If I de-assign this template under the toolset dashboard the fields appear (although incorrectly formatted as that was what I was hoping Toolset would do). I am using Divi but have also tried a YOOtheme and TwelveFifteen. Same results on all three. I have disabled Divi integration.

#541529
fot_ts_6.JPG
fot_ts_5.JPG

I've added two pics. With a Toolset template and without per my previous thread. Without I see all fields. With Toolset I see only Title.

#541972

Nigel
Supporter

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

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

Hi Terrance

Normally when using Toolset there are 3 different resources which can render the content of your posts.

First, your theme PHP template files themselves. Unless specifically edited, they will not output the content of custom fields, which is where Views Content Templates come in.

If you create a Content Template and assign it to a post type then it will take over rendering the content area of the page from the theme template files. Such a Content Template can include shortcodes for your custom fields and output them.

You can also assign a Layout to a post type, and it will be used to render the content area of the post, and may include shortcodes to output your custom fields.

Note that if you assign both a Content Template and a Layout to a post type, Layouts wins and outguns Views.

From what you describe it sounds like you have a Layout assigned to display single posts of your custom post type (which it is not doing correctly), and when you de-activate this it falls back to a Views Content Template.

What I don't know is why your Layout isn't rendering the custom fields, and it would probably be best if I could take a look myself.

I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site.

Can you also confirm the post type we are talking about?

#542042

FYI. This post type I'm creating should have had a
Title
Image from external source
Date
Source of New
URL source of the news rendered as a "Read More"

It instead renders as Title, Image, Title. See NewsPost post type.

#542049

Nigel
Supporter

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

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

Hi Terrance

Perhaps you might want to describe what you are aiming for here, and where your data is coming from.

I can see the problems clearly enough.

Your custom post type of NewsPosts doesn't have any Types custom fields associated with it, where your Layout for NewsPosts tries to output the values of custom fields there is nothing to output.

You standard WordPress post type does have a Types custom field group assigned to it with several fields, but when I checked the most recent post ("Why should college students let their enemies speak?") I see that no data is entered for the custom fields, so when viewing the post if a Layout is assigned which outputs these custom fields using Types shortcodes then, again, there is nothing to output.

Why are the custom fields empty?

#542749
ts_6.PNG

I'm not sure what you're looking at. The fields in NewsPosts are populated. See attached photo. Also populated in standard posts. They fail to render when using a toolset template. they do render when using default template.

#542886

Nigel
Supporter

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

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

Screen Shot 2.png
Screen Shot 1.png

Hi Terrance

Screenshot 1 shows the settings for your custom fields group. Note the section "Where to include this Field Group" which is set to posts and pages. So these custom fields are available on standard posts, but not on NewsPosts. None of your NewsPosts posts have these fields, so there is simply nothing to output from them.

These fields are available on your standard posts, but they don't have any content, so, again, there is nothing to output. See Screenshot 2 where you can see the custom fields for the most recent post and which you can see are all empty, there is nothing to output.

The only content for this post is the post title and the post body. If your Template Layout includes a Post Content cell it will output the content of the post body. (Or you can add a Visual Editor cell and insert the wpv-post-body shortcode to output the post body.) The types shortcodes will not output anything because there is nothing to output.

#543877

Thanks much. Checking ....... The content is a CSV import from All Import module mapped directly to the above fields. So where's the data? Thanks again. Will update soon.

TD/Indian Hill Media

#543879

What am I missing? I've created the custom fields. Mapped them to a Template used by a custom post type and I get "The "Template for NewsPosts" layout does not include any shortcodes or cells that display post content, so your edits in the content area on this page will not appear anywhere. Hide editor area". And I don't see any fields on the custom post type page. When I mapped the custom fields to the template I added the shortcodes via the visual editor and saved them. What step am I missing?

Thanks muck,
Terry Dwyer

#543880
fot_ts_7.JPG

Here's the template and fields.

#544705

Nigel
Supporter

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

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

Hi Terrance

I looked again at your site to see what has changed.

You have a Layouts template assigned to the NewsPosts post types, and this template includes Types shortcodes to output the values of custom fields for the post.

But there is no data to output.

The NewsPosts post type isn't using the Types custom fields you created.

In Screenshot 1 in my earlier reply it shows the settings for your custom field group "artiicle_fields" (sic), which you can see is only be used with standard Posts and with Pages. Not with NewsPosts.

NewsPosts don't have any values for these custom fields to output. (I checked in your database in case they had been added previously and then the settings changed so that the data was there but hidden, but the data simply doesn't exist.)

I checked your standard Posts, where the NewsPosts content seems to be duplicated.

These do now have content in the custom fields, which should be output by the types shortcodes if you assign a template that includes them.

So I went to Toolset > Layouts and changed the usage of your NewsPosts template so that it is also being used for standard WordPress posts, and the custom fields are now being rendered when you view those.

You'll need to decide whether you are happy using standard Posts, or if you want to use NewsPosts, in which case you will need to update your settings for your custom field group so that they apply to NewsPosts, and then update the posts themselves so the custom fields are set.

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