简体   繁体   中英

Calling a wordpress plugin in the header with a hook

I have this plugin https://fr.wordpress.org/plugins/wayne-audio-player/ that is called in the footer but i need it to be in my header. I've managed to do that easily with some css. But then i've noticed this line:

 add_action('wp_footer', 'wayne_audio_player_markup');

So i tried this:

add_action('get_header', 'wayne_audio_player_markup');

But it doesn't seem to work. I would like to know if there's a way of calling this plugin in the header without css code.

You can do this:

remove_action('wp_footer', 'wayne_audio_player_markup');
add_action('wp_head', 'wayne_audio_player_markup');

With remove_action you can unregister any previously hooked functions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM