How to save template data into wp_post table (post_content column)

Is there a way to save template data into wp_post table?

I made a custom template that automatically makes tables and some sentences with the meta-data that users insert in. I wanted to make users choose a template and write in a standardized format with custom field. Users can now just put some text on my custom field (bottom of my post edit page) and click the template on the sidebar, then the contents show on the post page!

And part of my code on single.php (post page) is this and this is working perfectly.

?php the_content();    
                    if ( is_page_template('hkb-templates/coin-info-template.php') ) { 
                    hkb_get_template_part( 'coin-info-template' );
                    }
                    else {
                    }
                ?

However, I noticed that with this code, table of content plugin doesn't work :( . I realized TOC plugin checks the contents inside of wp_post table (post_content column) but my template does not save the data into SQL database. It just make contents displayed on the post page. So my content is invisible to TOC plugin. Any suggestions or ideas to solve this problem? Please help me.

Topic single wpdb templates custom-field posts Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.