body onload function on all sites

Hi guys, i am not very good in this, so somebody please give me quick tip how i can put this in my site on the body tag:

  • Predrag Dubajic
    • Support

    Hey Hannes,

    This actually means editing your theme files to include the code piece in <body> tag.

    I would suggest using child theme because changes made to parent theme will get overwritten by theme update.

    So basically what you need to do is access your WP installation files vie cPanel or FTP and navigate to /wp-content/themes/YOUR_THEME/ folder and from there edit header.php file.

    In that file you should be able to find a line of code like this one:
    <body <?php body_class(); ?>>
    It could be different from the above one but it depends on the theme used, important part is <body opening tag where you need to add above code.

    Basically it should look like this after edit:
    <body <?php body_class(); ?> onload="FensterAuf();">
    Hope this helps :slight_smile:

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.