I have the following code
$icono = get_post_meta($post->ID, 'icono', true);
<span>
<i class="<?php echo $icono;?>"></i>
function la_descripcion() {
global $wpdb, $post;
$icono = get_post_meta($post->ID, 'icono', true);
echo '<label><strong>Icono para el post</strong></label></br>
<input type="text" name="icono" id="icono" value="'.htmlspecialchars($icono).'" style="width: 300px;" /></br></br>';
}
I am using Wordpress, developing a custom theme. This is a Metabox where in theory I should capture a text field (fa-solid fa-clouds) with which I would add that class to show the corresponding icon. but it doesn't work can you help me? I thank you in advance for the time and help you can give me.
This statement is made within the WordPress loop. In this way it goes through each post and looks for the custompost of each one, and shows it in case it has something to show.