post meta – How to save HTML data into SQL post_content column
Question
I have a custom template file containing some HTML tags and get_post_meta function. I want to insert the HTML data into post_content column. Is there a wordpress function or SQL function to save into post_content column? I couldn’t find a good anwswer on the internet.
This is my custom template file.
<?php
// the post name is cryto name.
$cryto_name = get_the_title();
// Cryto Variables from SQL table
$ccf_company = get_post_meta( get_the_ID(), 'ccf_company', true );
$ccf_jurisdiction = get_post_meta( get_the_ID(), 'ccf_jurisdiction', true );
$ccf_symbol = get_post_meta( get_the_ID(), 'ccf_symbol', true );
$ccf_maximum_supply = get_post_meta( get_the_ID(), 'ccf_maximum_supply', true );
?>
<h2>Features of <?php echo $cryto_name ?></h2>
<figure class="ht-post__content table">
<table>
<thead>
<tr>
<th>Features</th>
<th class="has-text-align-center" data-align="center"><?php echo $cryto_name ?> (<?php echo $ccf_symbol ?>)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Developer</td>
<td class="has-text-align-center" data-align="center"><?php echo $ccf_company ?></td>
</tr>
<tr>
<td>Country</td>
<td class="has-text-align-center" data-align="center"><?php echo $ccf_jurisdiction ?></td>
</tr>
<tr>
<td>Symbol</td>
<td class="has-text-align-center" data-align="center"><?php echo $ccf_symbol ?></td>
</tr>
<tr>
<td>Max Supply</td>
<td class="has-text-align-center" data-align="center"><?php echo check_max_supply($db_coin_max_supply, $ccf_symbol) ?></td>
</tr>
</table>
</figure>
I already made a sql table and this template is working. However, I’m trying to save this HTML output into post_content column.
0
2 months
2022-06-20T09:56:55-05:00
2022-06-20T09:56:55-05:00 0 Answers
0 views
0
Leave an answer