Why does add_action() not run when placed in register_activation_hook()?

why does add_action need to go into main plugin file to be activated
instead of using the register_hook_activation()?

You’ve misunderstood how WordPress and PHP work. Any code that does not write to the database or a file is not persistent, and add_action() does not do either. Any time a WordPress page is requested by the browser the whole WordPress lifecycle runs. This includes loading and running plugins.

The way plugins work is that when they run, they can use add_action() or add_filter() to schedule code to run at later points during the page load. So when you use add_action() with wp_head you’re telling WordPress “when you run the wp_head action, please run this code”. This means that every time your plugin runs, you need to tell it to add your action, otherwise nothing will be added to wp_head.

The mistake you’ve made is that register_activation_hook() only runs whenever the plugin is activated. Any code in the activation hook will not run for subsequent requests.

why must tags be present in the $header_libs in order to be found in
tag, else the $header_libs will be found in the tag?

This is just HTML. Any thing inside <head> must be in a valid tag, like <link>, <script>, <title> or <meta>. You can’t just put text inside a <head> tag.

deneme bonusudeneme bonusu veren sitelerpulibet girişOnwin Güncel Giriştürkçe altyazılı pornocanlı bahis casinocanlı bahis casino siteleriOnwin Güncel Girişholiganbetholiganbet girişholiganbet güncel giriş