/
tag.php
executable file
·40 lines (35 loc) · 1.14 KB
/
tag.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
<?php //function to use featured image as background image
add_action( 'wp_head', 'vr_set_featured_background', 99);
function vr_set_featured_background() {
$page_for_posts = get_option( 'page_for_posts' );
$image_url = wp_get_attachment_image_src( get_post_thumbnail_id($page_for_posts), full, false );
if ($image_url[0]) {
?>
<style>
html,body {
height:100%;
margin:0!important;
}
body {
background:url(<?php echo $image_url[0]; ?>) #fff center center repeat;
}
.wrapper {
height: auto;
}
</style>
<?php
} //end if statement
} //end vr_set_featured_background() function
// get_header();
?>
<?php get_header(); ?>
<div class="main">
<div class="container container-blog clearfix">
<div class="content">
<h1>Tag Archives: <?php single_tag_title(); ?></h1>
<?php get_template_part( 'loop', 'tag' ); ?>
</div> <!-- /.content -->
<?php get_sidebar(); ?>
</div><!-- /.container -->
</div><!-- /.main -->
<?php get_footer(); ?>