Skip to content

Commit

Permalink
Added code for dominant color for image thumbnail to the basic page t…
Browse files Browse the repository at this point in the history
…emplate. Removed Converter page template from list of templates.
  • Loading branch information
stefanbohacek committed Mar 12, 2018
1 parent 6ba09b4 commit e44aa76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion archive/template-converter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
/* Template Name: Converter */
use ColorThief\ColorThief;
$Parsedown = new Parsedown();

Expand Down
3 changes: 3 additions & 0 deletions template-basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/* 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; ?>">
Expand Down

0 comments on commit e44aa76

Please sign in to comment.