php – Use wp_head hook on template page

Question

I try to use the hook wp_head on a template page but this does not work

add_action('wp_head', 'to_head');

function to_head(){
    //do stuff
}

I place this code on a template part what is called by get_template_part( 'temp-parts/content/pages/catalog' );

Can you use the hook only on the functions.php or is there a way to use this on any page

0
Jop 2 weeks 2021-04-02T05:26:25-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse