echo get_option in header template

There’s quite a few issues with your code:

  1. Your code is only defining a function if the condition is true. It doesn’t actually output anything.
  2. Your condition is using a strict comparison to 1, but options will always be strings and 1 does not === to '1'.
  3. That function is only defined it if it’s already defined, which is paradoxical.
  4. You have not mixed HTML and PHP correctly. This would be the source of any PHP issues. You need to properly concatenate and pay attention to when your quotes, " and ', are opened and closed.

What you should do is always define the function, and just check the condition inside the function. This should be done in functions.php, then you should call that function in header.php.

So in functions.php your function should look like this:

function vis_undertoner_reklamebanner() {
    if ( get_option( 'undertoner_reklamebanner_boolean' ) === '1' ) {
        echo '<div class="reklamebanner">
                <a href="' . get_option( 'undertoner_reklamebanner_hjemmeside' ). '" target="_blank">
                    <img src="' . get_option( 'undertoner_reklamebanner_reklamebillede' ). '" />
                </a>
            </div>';
        }
    }
}

Then you use it in header.php like this:

<?php vis_undertoner_reklamebanner(); ?>