-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate-basic.php
30 lines (28 loc) · 1.11 KB
/
template-basic.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
<?php
/* Template Name: Basic Page Template */
get_header();
$post_id = get_the_ID();
$dominant_color = get_post_meta( $post_id, 'dominant_color', true );
$dominant_color_css = str_replace('[', 'background-color:rgb(', $dominant_color);
$dominant_color_css = str_replace(']', ')', $dominant_color_css);
?>
<main role="main" class="container-fluid m-0 p-0">
<div class="thumbnail-wrapper" style="<?php echo $dominant_color_css; ?>">
<?php
$post_thumbnail_id = get_post_thumbnail_id();
the_post_thumbnail('post-thumbnail', ['data-src' => get_the_post_thumbnail_url( $post_thumbnail_id ), 'class' => 'lazy-load', 'title' => get_post( $post_thumbnail_id )->post_title ]);
?>
</div>
<div class="container">
<article id="post-<?php echo $post_id; ?>" <?php post_class(); ?>>
<h1><?php the_title(); ?></h1>
<ul class="btn-list">
<li>
<a class="btn" href="#">Button</a>
</li>
</ul>
<?php echo do_shortcode( get_post_field( 'post_content', $post_id) ); ?>
</article>
</div>
</main>
<?php get_footer(); ?>