Its not a browser cache problem.
I found the solution
add_action( 'wp', 'addtx_homeheader' );
function addtx_homeheader()
{
if(is_front_page())
{
add_action('wp_head', '_set_metatag');
}
}
function _set_metatag()
{
$output = '';
$output .= '<meta property="og:type" content="MYPLUGINTEST" />';
echo $output;
}
No
If I use is_front_page() or is_home not working by using is in a custom plugin.
But this works when I put that directly in header.php
if(is_front_page())
{
$output = '';
$output .= '<meta property="og:type" content="website" />';
echo $output;
}
Why this is not working if a create it in a plugin?
if(is_home())
{
add_action('wp_head', '_set_metatag');
}
function _set_metatag()
{
$output = '';
$output .= '<meta property="og:type" content="website" />';
$output .= '<meta property="og:url" content="http://website.com" />';
$output .= '<meta property="og:title" content="websitetitle" />';
echo $output;
}
Note : I tested is_home() and is_front_page()