我有自己的wordpress主题的这些代码,我希望我的背景图像有一个指向其他网站的链接
<?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 } ?>
答案 0 :(得分:0)
这样的事可能是合适的:
<!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>