WordPress Background image with URL link

I have these code from my wordpress theme, i want my background image to have a link to other website

<?php get_header(); ?>
<?php if (class_exists('BlackfyreMultiPostThumbnails')) : $custombck = BlackfyreMultiPostThumbnails::get_post_thumbnail_url(get_post_type(), 'header-image', $post->ID, 'full' ); endif; ?>
<?php if(empty($custombck)){}else{ ?>
<style>
    body.page{
    background-image:url(<?php echo esc_url($custombck) ; ?>) !important;
    background-position:center top !important;
    background-repeat:  no-repeat !important;
}
</style>
<?php } ?>

Related posts

1 comment

  1. Something like this might be suitable:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Example</title>
    <style>
        BODY.enterPage{
        cursor:hand;
    }
    </style>
    <script>
       function goto(){
           location.href = "http://www.stackoverflow.com"
       }
    </script>
    </head>
    <body class="enterPage"  onclick="goto();">
        <a href="www.stackoverflow.com">Enter</a>
    </body>
    </html>
    

    From this forum

Comments are closed.