add_action(‘wp_head”) cannot adding styling to head

I have the following php code:

add_shortcode("hello","hello_func");
function hello_func(){
    add_action("wp_head","styles");
    add_action("wp_footer","scripts");
}
function styles{
    echo "<style>blahblahblah</style>";
}
function scripts{
    echo "<script>blahblahblah</script>";
}

For some reason, the scripts will be loaded into the footer, but the styles will not be loaded into the footer. Can anyone help?

Related posts

Leave a Reply

2 comments