Skip Navigation

[Resolved] Layout is not working on single posts

This support ticket is created 5 years, 1 month 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
- 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/Karachi (GMT+05:00)

This topic contains 21 replies, has 3 voices.

Last updated by Waqar 4 years, 11 months ago.

Assisted by: Waqar.

Author
Posts
#1390463
#1392363

Hi Hadi,

Thank you for sharing the admin access for the other website.

Shane is on vacation and will be back next week, so I'll be following up on this ticket.

I noticed that the layout "Template for Posts" is working as expected for the single post pages on this other website.

To troubleshoot why this is working on one website with "YOOtheme" and not on the other one, I'll need to thoroughly compare the clones of these two websites, on my own server.

Do I have your permission to download the fresh clones from these websites, using the Duplicator plugin?

regards,
Waqar

#1392403

Hi Waqar ,

Yes, you have the permission.
Thank you

#1393221

Hi Hadi,

Thank you for your permission and I've downloaded duplicator packages from both these websites.

I'll perform some tests and will update you with my findings.

regards,
Waqar

#1398235

Hi Hadi,

I just wanted to update you that I've managed to narrow down few differences between the two websites and I'll share my detailed findings with you today.

Thank you for your patience.

regards,
Waqar

#1399711

Hi Hadi,

Thank you for waiting as this troubleshooting, took longer than initially expected.

During testing on these clones and on my own test website, I discovered that the Layouts assigned to single post pages, don't apply on the front-end when using YOOtheme.

This seems to be happening only with newer versions of the theme as with older versions like 1.20.6 or 1.21.10, the layouts work correctly.

Appreciate you brought this forward and I've shared these findings with the concerned team. I'll keep you updated on the progress through this ticket.

For now, a workaround can be to keep using the older 1.21.10 version of the theme on your websites.

regards,
Waqar

#1401323

Hi Hadi,

I just wanted to update that our compatibility team has contacted the YOOtheme to inform them about this compatibility issue, along with some suggestions.

In their newer releases, they're calling post content using functions that are not considered WordPress' theme development standard and this is expected to result in more compatibility issues with other WordPress plugins as well.

If you'd like to continue using this theme, we'll recommend getting in touch with their support team too, to let them know that maintaining compatibility with Toolset (and other WordPress plugins) is important for you.

For a quick fix, you can register a custom function to get the post's content in WordPress' standard way and then call it in theme's single post templates.

Example:


function my_custom_content_func() {
	// Apply filter from 'the_content()' (wp-includes/post-template.php)
	$content = apply_filters('the_content', get_the_content(''));
	$content = str_replace(']]>', ']]>', $content);

	return $content;
}

The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through active theme's "functions.php" file.

Next, in the theme's single post content templates ( e.g. /yootheme/templates/post/content.php ) you can call this function like this:


echo my_custom_content_func();

I hope this helps and please let us know if you hear back from the theme author.

#1437361

Hi Hadi,

We've received confirmation from YOOtheme that a fix for this will be included in the next release.

Thank you for bringing this forward and please update the theme to the latest version, once it is out.

regards,
Waqar