0

I'm trying to write a plugin by which a meta code will be added to specific post type header. I tried to use this code:

function msc_header() {
if ( is_singular( 'article' ) ) {
        echo '<meta name="site_title" content="'.'test test'.'">'."\n";
        }
}
add_action('wp_head','msc_header', 0);

But nothing happened. I got no error but no code was added. Am I missing something here?

1 Answer 1

1

It's should be return rather than echo.

return '<meta name="site_title" content="'.'test test'.'">'."\n";
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.