This is a continuation of the problem here:
https://toolset.com/forums/topic/cred_link_form-not-working/page/2/
While waiting for a response, my business partner and I have purchased Toolset under this ID (my personal ID while evaluating was MichelleM5160)
I have tried adding the following to my child theme functions.php
/** Make sure the editing mechanism works **?
add_filter('get_layout_id_for_render', function($id, $slug){
global $post;
if( null !== $post && $post->post_type === 'listing' && isset($_GET['cred-edit-form']) ){
$id = '5904';
}
return $id;
} );
but there is no change - the editing page still shows the actual post with the CRED form in the description area.
Please can BEDA take another look
Thanks
Michelle
Hi Johanna,
This is Mohammed, the Toolset support team leader.
Beda already finished his shift and of course, he will get back tomorrow to continue his work.
I'm forwarding this to him so that he can take care of it.
Thanks.
This works fine.
1. Create a Layout with slug "cred-edit-form"
2. Manipulate your Current layout with which you link to the CRED Form and insert the CRED edit Link
3. In the Layout "cred-edit-form" insert the CRED Edit Cell
4. Insert in your theme's functions.php this:
add_filter('get_layout_id_for_render', function($id, $slug){
global $post;
if( null !== $post && $post->post_type === 'post' && isset($_GET['cred-edit-form']) ){
$id = '31';
}
return $id;
} );
Note that you need to change "post" in post type to your Slug of your Post Type you edit.
This will work, it will render the CRED form with your Layout "cred-edit-form" and not with the Layout used to create the actual contnet and display the link.
I tested this locally.
Maybe, to make a clean test, try to create a Layout with the Link to the form only, and a Layout as instructed, with the CRED Form Cell only.
Then, if that does not work, it is something in the server or on your Theme, as this works fine locally.
If all fails, please add the Access Details below.
Your CRED Edit Form Layout has ID 6190
Why are you calling ID 6011 in your Code?
If that does not fix the issue, can you try to deactivate "Toolset Classifieds" Plugin to test it?
It might be that this code in the Plugin is interferring with the new one.
Let me know if this solves the problem. We might then need to enhance the above Code.