How to apply Cloud Template to existing posts

Posted in: Newspaper
Post count: 72

We have finally started using cloud templates, modified to suit our site.
But up to now we have never used these, the site was developed with a very early version of TD Composer and we did not use templates.

So now, in the backend only, when I click on a link I get this error on most pages:
wp_booster error:
td_api_base::mark_used_on_page : a component with the ID: single_template_5 is not set.
/www/wp-content/plugins/td-composer/legacy/common/wp_booster/td_api.php

I have figured out that if I apply one of my new templates to this post through:
Edit Post>Post Settings>General>Post template:
the error goes away. Problem solved, for this one post.

So the solution seems simple enough, I just have to apply the correct template to over 10,000 posts…
Obviously that is not a workable solution.

Is there any way to edit the post info in the database to assign a template for a great number of posts at the same time? Is this stored in wp_postmeta?

Any help would be appreciated.

Thanks,
Kim Christiansen

Post count: 27744

Hello, Kim,

This error appears if you don’t have the tagDiv Standard Pack plugin activate, and your posts have assigned a standard post template from that plugin.
So, you don’t have to set any post template, then it should be “From Panel”, then will be applied the post template set as Global.
If you want to reset all post templates to be set from Panel, you need to make a full backup to your website and database and after that, you need to use this SQL in database -> https://pastebin.com/WR4MAT7U

Hope this helps you!

Thank you!

Post count: 72

Hi Anamaria,

Thanks, that set me in the right direction. I noticed that several posts had other data in the td_post_theme_settings. I don’t know if it’s supposed to be there or not but it is. It looks like Yoast data…
An example:


a:3:{s:10:"has_review";s:10:"rate_stars";s:14:"p_review_stars";a:3:{i:0;a:2:{s:4:"desc";s:26:"Very simple, rugged design";s:4:"rate";s:3:"4.5";}i:1;a:2:{s:4:"desc";s:27:"Clean design inside and out";s:4:"rate";s:3:"4.5";}i:2;a:2:{s:4:"desc";s:11:"Easy towing";s:4:"rate";s:3:"4.5";}}s:6:"review";s:218:"The Rustic Trailer Teardrop Campers Koala Bear travel trailer is a small, rugged and very simple option for campers who wish to elevate their tent camping experience or downsize from a complicated more traditional RV. ";}

So instead of just nulling that field for all posts, I located the standard pack template we were using and replaced just the portion of the text that I needed. This is what I used:


UPDATE wp_postmeta SET 'meta_value' = REPLACE('meta_value', 's:17:"single_template_5";', 's:15:"single_template";') WHERE 'meta_value' LIKE '%s:17:"single_template_5";%' COLLATE utf8mb4_bin

That fixed the problem completely.

This is yet another example of how poorly tagDiv managed the upgrade path from v9 to v10 (I have posted about this at length). This kind of thing >should< have been taken care of by your team or at least made a tool to make the one time upgrade from an older v9 site to the v10 without using the standard pack plugin.

The legacy code from the standard pack is killing our CPU usage (and probably costing us $100-$200 USD a month in CPU charges). I’ve put off removing the standard pack as long as I can but now I have to essentially rebuild the entire site.

Believe me when I say that another theme and page builder was calling my name the entire time I have been struggling with this problem…

Thanks for the info, I’ll get back to work and quit complaining now.

Kim

  • This reply was modified 5 years by imkimc.
  • This reply was modified 5 years by imkimc.
Post count: 27744

Hello, Kim,

We are sorry for these inconveniences.
We try to make the way a user interacts with the theme to be flexible and easy to use as possible. Unfortunately, we may not always be able to make this possible, but we will try to be as careful as possible in the future.

Thank you for your understanding!

Post count: 72

Hi Anamaria,

So I have cleaned up all of the old “standard_template_(1,2,3,4,5,6,7,8,9,10)” lines from the wp_postmeta table and now I can find no trace of that anywhere. However, when I look at the bottom of every post, there are several choices,
“From Panel” which the one I typically want
“Default” which actually points at something called “single template” even though I no longer have the standard pack loaded.
“Custom” Which point to the cloud library templates I have created.

How do I get rid of that “standard profile” option at the bottom of every post. Someone is going to choose it at some point and post an article that doesn’t work correctly!

Thanks,
Kim

Post count: 72

Update: I found that the wp_options table also contained an old entry for
s:29:"td_default_site_post_template";s:17:"single_template_5"
I removed that and made sure that the default template for the site was strill my custom cloud template.
I rechecked the database and the theme put this back into td_011:
s:29:"td_default_site_post_template"
Which still points to something called “Standard Template” that I cannot edit.

What can I do?

Kim

Post count: 27744

Hello,

Indeed, is a Standard Template, but this is a standard template from WordPress and this is used as default (this is provided in the theme files to be use when the tagDiv Standard Pack or tagDiv Cloud Library are disable).
There is no option to remove it.

Thank you for your understanding!

Viewing 7 posts - 1 through 7 (of 7 total)
The forum ‘Newspaper’ is closed to new topics and replies.