I am trying to add this code in functions.php but it is giving me the error
add_filter( 'the_content', 'misha_add_something_description_tab' );
function misha_add_something_description_tab( $content ){
if( is_product() ) { // I recommend to always use this condition
$content .= '<table class="vertical-menu">
<tbody>
<tr>
<td class="cabecera"><?php if( get_field('download') ): ?><strong><i class="icon-checkmark"></i>Download:</strong></td>
<td class="detail"><strong><?php the_field('download'); ?><?php endif; ?></strong></td>
</tr>
<tr>
<td class="cabecera"><?php if( get_field('color') ): ?><strong><i class="icon-checkmark"></i>Color:</strong></td>
<td class="detail"><strong><?php the_field('color'); ?><?php endif; ?></strong></td>
</tr>
</tbody>
</table>';
}
return $content;
};
I want this content to be added after the product description
2
Answers
click here to open the error image
Hello, the error keeps appearing, please could you help me solve it.
Use the following code in functions.php or create a child theme. I have used action hook.