Hi,
I have create a description field and i want to call this in the header with this code :
// meta description
function wpse_custom_meta_description()
{
if ( ! is_single() )
return;
$desc = get_field('meta_description');
// Output
if( ! empty( $desc ) )
printf(
'<meta name="description" content="%s" />',
esc_attr( trim( $desc ) )
);
}
add_action( 'wp_head', 'wpse_custom_meta_description' , 2 );
// meta description
But $desc is umpty !
Who to do ? Thankyou
The code I created works very well, it will not pose any problem in the future is it right?