Skip Navigation

[Resolved] Template for custom post works OK in block editor, but not in front end view

This support ticket is created 4 years, 11 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 15 replies, has 2 voices.

Last updated by henrikH 4 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#1523915

I have made a template for a custom type. Everything is put in Toolset grid works OK in block editor, but when I want to see front end view, the custom post is shown in the traditional view for a normal post with none of my single fields shown.
hidden link

What can be wrong? I think I have checked all settings but I might be wrong.

#1523997

For info, I have pressed update before front-end view.

#1524607

Nigel
Supporter

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

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

I don't see any debug info for your site so I don't know what other plugins you have installed.

hidden link

Are you using any other plugin (such as Elementor Pro) which has a templating system? Or your theme offers dynamic templating (e.g. Divi)?

It seems the most likely explanation that Toolset templates are losing the race to control what template is used on the front end.

#1525337

Hi Nigel. You are right, and my Newspaper theme does not work with Toolset. I disabled the Newspaper site builder, and the custom types show the Toolset pages just right.

I guess I have to switch to either Avada or Divi. Have you any experience which works best with Toolset? Thanks in advance.

Best, Henrik

#1525425

Nigel
Supporter

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

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

I hate to make such recommendations as I'm not the one building the site, but I would say that we tend to have more problems keeping up with the ever-evolving Divi than we do with Avada.

Check the known issues page and you'll see we tend to get more problems with Divi, but that could be because there are more people using it: https://toolset.com/errata/

In any case, as you are probably aware we are making a big push on improving the Block editing experience and that is our main focus for now, so I would suggest a simple theme that works well with the Block editor which should be more future-proof.

#1525429

Ok, thanks :-). However, I can see in your showcase directory that actually two sites with Newspaper theme has used Toolset, so maybe I can ask a contractor to try to make it work.

#1525511

Debug info inserted

#1526795

Nigel
Supporter

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

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

From previous reports in the forums I can say that the Newspaper theme uses non-standard methods to output post content in its PHP templates (i.e. it does not output the content using the WordPress the_content() function).

If the theme uses a custom function to output the content then you can register that function and the templates should still work on the front end.

Go to Toolset > Settings > Front-end Content and see the section "Theme support for Content Templates".

#1526919
debuginfo.png

Thanks. I have inserted "get_content" in "theme support for Content Templates. I can see in Newspaper forum that this works for some, but not others. Unfortunately not for me.

I get the debug info attached.

#1527135

Nigel
Supporter

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

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

In your screenshot it says registered valid functions are get__content, note it has two underscores.

If this doesn't work then the only option is, in a child theme, to make a theme template file where the content is output by the_content() function.

So if your post type is producent then make a copy of the theme's single.php template and name it single-producent.php.

That template will be used just for displaying single producent posts.

You would need to edit the PHP file, identify which part of it is responsible for outputting the post content, and then replace that with the the_content() function (https://developer.wordpress.org/reference/functions/the_content/).

Try looking at one of the default themes and its single.php to see how it is normally used.

#1530483

Thanks a lot for the detailed description, I will try to implement this.

#1530611

Nigel
Supporter

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

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

OK, let me know how you get on...

#1537111

Hi Nigel. I am asking Newspaper to help with this, perhaps I will pay them to develop at template that works with Toolset. If I am lucky I can perhaps share it. I can see in the Newspaper forum that several people have had troubles combining Newspaper and Toolset. I let you know this week the progress.

#1537135

Nigel
Supporter

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

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

OK, do let me know if you have a solution you can share. Thanks.

#1546601

Hi, I have not solved this yet, but I can see I can with problems create views for custom types using the block editor so I guess this will be a very fine solution for me just now :-).