I have a big problem. In a Wordpress page I've a function that generate og meta tags. I want to "append" that generated meta in the head section. So, I write this code:
add_action('wp_head', '_set_meta_tag');
function _set_meta_tag()
{
global $nome;
global $descr;
global $file;
global $path_meta;
$output = "";
$output .= '<meta property="og:title" content="'.$nome.'" />';
$output .= '<meta property="og:type" content="article" />';
$output .= '<meta property="og:image" content="'; $output .= get_bloginfo('template_url'); $output .= '/includes/img/immagini_evento/'.$file.'" />';
$output .= '<meta property="og:url" content="'.$path_meta.'" />';
$output .= '<meta property="og:description" content="'.truncate(htmlentities($descr),200).'" />';
$output .= '<meta property="og:site_name" content="'; $output .= get_bloginfo('name'); $output .='" />';
echo $output;}
add_action('wp_head', '_set_meta_tag');
not display $output
. Why?
I've prooved also to echoes a simple "hello world", but nothing happened!