Hi guys,
In the content analysis Yoast is telling me that my content has 0 words. I assume this is because for this CPT i removed the standard editor for this post type. However, i do have a custom field that holds the most important information. How can i assign this field as the 'standard editor'?
Thanks!
Hello and thank you for contacting the Toolset support.
I am sure you will understand that we can't support how Yoast Analysis is working. I suggest reaching the Yoast support team and asking there. If they provide more information and you still need our assistance, get back here and we'll do our best to help.
From a toolset perspective, I will suggest syncing this custom field value to the content of the post with a custom code that you can add to Toolset->Settings->Custom code.
This code will hook into the "save_post_post-post_type" action and will update the content of the post from the value of the custom field. https://developer.wordpress.org/reference/hooks/save_post_post-post_type/
Check this example for a custom post type "book" and a custom field "summary":
function ts_sync_content_value( $post_id ) {
// get the value of the custom field
$content = get_post_meta( $post_id, 'wpcf-summary' );
// prepare post object
$post = array(
'ID' => $post_id,
'post_content' => $content,
);
// Update the post
wp_update_post( $post );
}
add_action( 'save_post_book', 'ts_sync_content_value' );
I hope this helps. Let me know if you have any questions.
My issue is resolved now. Thank you!