wp head – Why function is not working in wp_head hook?

Question

I have two versions of the simplest function that hooked to the wp_head action.
One is working andother is not. Can someone explain ?

// Works !
function custom_description(){
     ?>
         <meta name="description" content="cococo" />
     <?php  
}

// Does not work
/*
function custom_description(){   
    return  '<meta name="description" content="cococo" />';
 }
*/

add_action('wp_head','custom_description');

0
Taras Parashchuk 1 month 2023-02-20T16:30:29-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse