-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathfull-banner.php
48 lines (39 loc) · 1.27 KB
/
full-banner.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
<?php
/*
Template Name: Full Width Banner
*/
/* body class */
add_filter('body_class','browser_body_class');
function browser_body_class($classes = '') {
array_push($classes,"fluid");
return $classes;
}
?>
<?php get_header() ?>
<?php do_action( 'bp_before_blog_home' ) ?>
<?php do_action( 'template_notices' ) ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $bannerimage = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
<?php $bannercolour = get_post(get_post_thumbnail_id())->post_content; ?>
<div class="banner" style="background-image: url('<?php echo $bannerimage[0]; ?>');<?php if (!empty($bannercolour)) { echo 'background-color:' . $bannercolour; }?>">
<div class="container">
<div class="text">
<h1><?php the_title(); ?></h1>
<span class="caption">
<?php echo get_post(get_post_thumbnail_id())->post_title; ?>
</span>
<?php echo get_post(get_post_thumbnail_id())->post_excerpt; ?>
</div>
</div>
</div>
<?php endif; ?>
<div class="container">
<div class="row">
<div id="content" class="span12">
<?php the_content(); ?>
</div>
</div>
</div>
<?php endwhile; endif; ?>
<?php get_footer() ?>