• Hello,

    maybe is missed it but I searched all the hooks for a way to hook to the body tag. Is there any possibility?

    My problem is that I want to add a div tag to the start of the body tag. For example to add a leaderboard. I only found a hook “the_content” but it’s still in the content area.

    Best regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Unfortunately there is no widely implemented hook for this. There is a body_class hook that you can use to add classes to the body tag but you probably know about it already. However, you could easily inject the HTML with the help of some JS.

    Thread Starter nam_webdev

    (@nam_webdev)

    Thanks for the reply and your suggestion. Yes, I already know of the body_class hook and the possibility of injecting HTML with JS but unfortunately both doesn’t help me. I wanted to accomplish this task without the use of JS.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hook for the body Tag?’ is closed to new replies.