/
page-home.php
executable file
·56 lines (45 loc) · 1.24 KB
/
page-home.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/*
Template Name: Home
*/
add_action( 'wp_head', 'vr_set_featured_background', 99);
function vr_set_featured_background() {
$image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), full, false );
if ($image_url[0]) {
?>
<style>
html,body {
height:100%;
margin:0!important;
}
body {
background: url(<?php echo $image_url[0]; ?>) #000 center top;
background-size: contain;
height: 100vh;
}
@media all and (max-width: 940px) {
body {
height: auto;
background-size: cover;
background-position: center top;
}
}
</style>
<?php
} //end if statement
} //end vr_set_featured_background() function
//get_header(); ?>
<?php get_header(); ?>
<div class="main main-home animated fadeIn">
<div class="container">
<div class="content">
<?php // Start the loop ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<h2><?php //the_title(); ?></h2>
<?php //the_content(); ?>
<?php endwhile; // end the loop?>
</div> <!-- /,content -->
<?php //get_sidebar(); ?>
</div> <!-- /.container -->
</div> <!-- /.main -->
<?php get_footer(); ?>