Skip Navigation

[Resolved] Post creation through a CRED form

This support ticket is created 6 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 13 replies, has 3 voices.

Last updated by Minesh 6 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#620426

Hi,

For a CTP I created a simple form on the front-end. Apparently it works fine and the post is created.

The problem is that the post is created with the default layout of the theme, with a side bar.

But if I go to the WordPress back-end and just update the post, it takes the correct layout assigned to it. Also when I create a post in the back-end the layout is ok too.

I don't want to have to go inside every post and update to apply the layout assigned to the post.

Can you help with this? Why the layout is not applied to the posts created through the form?

Thanks!

#620445

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand - you want to assign the specific layout when post is created using CRED form - correct?

#620468

Exactly. Just as when I create the post within the WordPress back-end.

#620469

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - could you please send me your CRED form ID using which you create the post and the layout slug which you want to assign it to newly created post.

#620478

Hi,

the Form ID is 153. The layout slug is: content-template-for-asociaciones-2

The layout is being applied, but not the layout settings for Divi. I choose Fullwidth, but when the post is created through the form, the right sidebar layout is applied.

Thanks for your help.

#620484

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ahh - so as I understand Layout is applied but the issue is only fullwidth setting?

I need check on your install. Could you please share problem URL from where you create new posts using CRED form?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#620555

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I can see that the right sidebar elements are available with your content template "Content template for Asociaciones":
=> hidden link

What if you remove the sidebar elements from above content template?

#620953

The content template has no sidebar elements. No widgets, nothing. It just does not apply the full width layout from the Divi, although I selected full width in the template setting.

Can you please take a look? You can create a random post if you want to see what happens.

#621290

Hello,

Minesh isn't available currently, you will get his answer in the answer when he is back on Monday.

Here are my suggestion:
If you want to display post content as full-width cell, you need to put the content insider a full-width row, for example, edit the page "Formulario"
hidden link
click the setting of row, in the "Row Module Settings" window, click tab "Design", option "Make This Row Fullwidth:" choose "Yes", and test again

#621497

It does not work. The problem is not with the Divi Builder. The problem is that the post is created differently if I do it from inside WordPress or from the CRED Form. The problem is with the setting of the Full width option inside the content template page.

So I will repeat again: The layout is being applied, but not the layout settings for Divi in the content template page. I choose Fullwidth, but when the post is created through the form, the right sidebar layout is applied. This does not happen if I create the post from within WordPress.

Please help. Thanks

#622054

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - could you please share URL of post that is created within the WordPress and one post URL that is created using the CRED form. I mean one working URL and one not working URL.

I have set the next reply to private which means only you and I have access to it.

#622654

OK.

Posts should look like this one:

hidden link

Wrong posts created through the CRED form look like this:

hidden link

The Divi fullwidth is not applied. If you go inside WordPress and open that post and save it, then it looks fine, but I want it to be ok without having to save every single post.

I hope you understand this time.

Thanks
Daniel

#622825

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - I can see the difference now before that I was only seeing the full width layout.

I've added following code to your current theme's functions.php file:

add_action('cred_save_data', 'my_save_data_action',10,2);
function my_save_data_action($post_id, $form_data){
	if($form_data['id']==153) {
			update_post_meta($post_id,'_et_pb_page_layout','et_full_width_page');
    }
}

_et_pb_page_layout is the meta key that holds the fullwidth layout with value "et_full_width_page" so whenever post created using CRED form we need to add this metakey with metavalue and you will see now fullwidth layout even with posts created using CRED form.

Could you please confirm it works for you as well.

#623269

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Is the solution I shared works at your end?

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.