[Resolved] When importing posts the Template Layout is not assigned
This thread is resolved. Here is a description of the problem and solution.
Problem:
When importing posts from a CSV file using an import plugin the default Template Layout doesn't get assigned, and setting it manually for each of the imported posts would be too time-consuming.
Solution:
If you view the list of templates at Toolset > Layouts where there are posts which do not use the template assigned to that post type there appears a small orange link to bind posts. Pressing that will assign the Template Layout to all the posts in bulk.
0% of people find this useful.
This support ticket is created 6 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.
I am trying to:
Import massive custom post using your recommended WP Ultimate CSV Importer.
Link to a page where the issue can be seen:
Works perfectly, but there is no way (I didn't found) how to set the default template layout. So when import finish the template layout says "don't use a layout" So I have to manually select to fix that
There is someway to put this template layout as default for that custom post?
If you go to Toolset > Layouts and you see a list of your Template Layouts, if you have a template assigned to a post type and there are posts of that type not using the template, you should see a small orange link to "bind x posts" which will assign all of the unassigned posts.
Yes. I see that button. However I expect to define the default template layout for that custom post type by default. Is not practical to have to press the button every time an import is made.
There is anyway to define something like: custom post type "movies" --> default template is "layout_movies"
When you create a Layout and assign it to a post type, that's what you are doing, specifying the default Layout for those posts.
But because individual posts can use a different Layout, the Layout to be used is stored as post meta for each post.
When a new post is published the Layout will be automatically added to the post meta, but when you import posts you bypass this and need to set the post meta. You can update individual posts, use the "bind" link to do that in bulk, or you could import the posts with the custom field for the layout set.
The layout assignment is stored in a custom field with key "_layouts_template" and the slug of the Layout as the value.
So your import file could includes a column for the _layouts_template field.
Depending on how you generate it that may be less work than pressing the bind button.
Thanks for the nice explanation Nigel, this is a really good one explanation of how works.
So far, the issue seems related to WordPress Ultimate CSV Importer Pro. And I resolved looking into php my admin and the exact meta value, using that the excel, and using the value you give me as column when importing with the correct layout is working without problems. So you point me in the right direction! many thanks ?
Hi, sorry but I can't see where is the fields to import : _layouts_template.
I try to add custom field in "Wordpress Custom Field" on the mapping... but it does not work.
Could tou help me ?