Skip Navigation

[Resolved] Content Templates theme function detect

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.

Our next available supporter will start replying to tickets in about 8.66 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 10 replies, has 2 voices.

Last updated by emanuelaB 6 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#908120

I am trying to:
use types 3 and views 2.6 with TagDiv Newspaper Theme

I expected to see:
Content Model displayed in post and page

Instead, I got:
"Standard" WordPress post and page display

as explained also in another ticket, I've updated Types and Views and content model were no longer displayed.

I've enabled debug mode and I discovered that the function used by the theme (TagDiv Newspaper) seems to have become td_module_single_base::get_content.

I've been using that theme for years on many sites with Toolset Plugins, and I've always used just get_content in wpv-content-templates-theme-support-function configuration field.

in the other mentioned ticket, you said "Toolset does not change those functions, they are not ours, they are theme's functions, we just detect them."

but I didn't update the theme, so I suspect that Views 2.6 does wrongly detect the function, and I think it should be a problem, because if I use td_module_single_base::get_content everything is fine, but if my customer update Types and Views without knowing that he have to change also the function in Toolset configuration I'm afraid they could break the site-

Is there a way to avoid this?

Thanks, Luca

#908658

Dear Luca,

Since it is a compatibility problem, please provide a copy of the "TagDiv Newspaper Theme",

You can put it into your own google drive disk, and share the link in the "private detail box", I need to duplicate same problem and debug it in my localhost, thanks

#909645

Thanks for the detail, we get a feedback from other clients who are using Newspaper theme:
"td_module_single_base::get_content" is the only function used to get content throughout the Newspaper theme
https://toolset.com/forums/topic/toolset-cpt-integration-with-newspaper-theme/

so you will need to inform your customer to update the setting in:
in Dashboard-> Toolset-> Settings-> Front-end Content -> Theme support for Content Templates.

Since the function name is defined by Newspaper theme, I don't think it is possible to change it in Toolset side.

#911688

Thanks for your reply, but honestly I don't understand.

I've been using Newspaper and Toolset plugins together for several years and I've ALWAYS used simply "get_content": on a couple of test sites I've just updated Toolset Views (nothing else) and I had to change that value.

How is it possible, if, as you say, Newspaper uses only "td_module_single_base::get_content"?

Sorry if I insist, it would not be a big problem if I do not have to update many sites, and, most of all, some of them managed directly by my clients.

Thanks again, Luca

#911736

The function name is defined by your theme files: "Newspaper theme", if the author of "Newspaper theme" changed the function name, you will need to change the option in Toolset settings:
Dashboard-> Toolset-> Settings-> Front-end Content -> Theme support for Content Templates.

Hope it is clear.

#911763

No, sorry, it's not clear.

You said that the author of Newspaper theme changed the function name, maybe it's true, but on the same site I've used for the previous test I've deleted the newest Types and Views releases (3.0 and 2.6) and uploaded Types 2.3.1 and Views 2.5.2, without changing the teme version and anything else.

Enabling Toolset debug mode, I get that result (it's in Italian, but I hope its clear)

Debug del modello di contenuto:
Le funzioni chiamanti sono get_content

and if I use get_content as theme content function everything works as has always did.

Using the Types 3.0 and Views 2.6 I get that

Debug del modello di contenuto:
Le funzioni chiamanti sono td_module_single_base::get_content, WP_Hook::apply_filters

Is it possible you've changed the way you detect the theme function or something else is changed in WordPress core (I'm using WP 4.6?

Thanks again, Luca

#912194

Thanks for the details, I am download the old version of Views plugin, trying to duplicate the same problem as you mentioned above, will feedback if there is anything found

#912227

I can duplicate the same problem:
With Types 2.3.1 and Views 2.5.2 + Newspaper theme, and enable the Toolset setting option "Enable theme support debugging", I get the function name:
Calling functions are get_content

With Types 3.0 and Views 2.6 + Newspaper theme, I get the result:
Calling functions are td_module_single_base::get_content, WP_Hook::apply_filters

So you are right, it is Toolset changed the way you detect the theme function.

#914853

Hi
thanks for your reply.
just to close this ticket, I assume from your answer that there is no way to force the old detection type, is it correct?
Thanks again, Luca

#915040

Yes, you are right, in your case, I suggest you use the function name "td_module_single_base::get_content" instead of get_content, that is confirmed by the author of Newspaper theme.

#915082

ok, thank you