Tracking doesn't work wich custom wordpress theme

Hello kuba

Thank you for your reaction! It would be an IP address, but, in the meantime I figured out is isn’t Wordfence that is causing the problem but the theme that the website uses. Because everything works fine when I switch to the default Twenty Twenty-three theme.

So my question has changed. I didn’t find the wp_body_open() function in the theme. I tried to add the following snippet:

if ( ! function_exists( 'wp_body_open' ) ) {
    function wp_body_open() {
        do_action( 'wp_body_open' );
    }
}

with the ‘Snippets’ plugin. But that doesn’t work. Any suggestions what I can do next?

(Maybe I’d better close this topic and start a new one?)

Kind regards
Karin

Hi. I moved the question to a separate topic. Let me check with the team what’s the solution.

1 Like

If function wp_body_open() is not implemented in your theme, you can add it manually using a theme editor from the Administration Screens > Appearance > Editor menu in WordPress Admin, pasteing:
<?php wp_body_open(); ?>
right after the opening <body> html tag, or use other editing files method described in: Editing Files

Thank you! Added to the theme and now everything works flawless!

1 Like