Skip to content

Instantly share code, notes, and snippets.

@elicus
Last active February 20, 2020 12:47
Show Gist options
  • Save elicus/213c72b464c49d1abda36653b66d4863 to your computer and use it in GitHub Desktop.
Save elicus/213c72b464c49d1abda36653b66d4863 to your computer and use it in GitHub Desktop.
Divi Blog Extras Custom Post BG Color
$postbg = get_post_meta( get_the_ID(), 'postbg', true);
if( ! empty( $postbg ) ) {
$postbg = get_post_meta($post->ID, 'postbg', true);
$posts .= '<div class="post-content" style="background-color: '.$postbg.' ;">';
} else{
$posts .= '<div class="post-content">';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment