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?
Try using wp_enqueue_script or wp_enqueue_style. This is normally the best way to add styles or scripts to WordPress. You can also pass a parameter in the wp_enqueue_script function to add the script to the footer.
Maybe do a
(guess)