Use Yoast Filter to modify value of wp_head output?
-
I want to modify my wp_head. I am using the Yoast plugin I want to add a new custom meta tag after the description meta tag. I try this code for add keyword tag but it’s not shown after the description tag its shown in a lower position this code
/*Display custom meta keywords or the post excerpt */ function add_custom_meta_key(){ #Single Page Meta Description if( is_single() ){ $key = get_post_meta( get_the_id(), 'keywords', true); if( ! empty( $key ) ){ $meta_key = esc_html($key); echo '<meta name="keywords" content="' . $meta_key . '" />'; } }} add_action( 'wpseo_head', 'add_custom_meta_key', 2 );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Use Yoast Filter to modify value of wp_head output?’ is closed to new replies.