Skip to content

Instantly share code, notes, and snippets.

@InTheCloudDan
Created September 10, 2016 23:56
Show Gist options
  • Save InTheCloudDan/9384d0f80c75e8764c73e11f28533201 to your computer and use it in GitHub Desktop.
Save InTheCloudDan/9384d0f80c75e8764c73e11f28533201 to your computer and use it in GitHub Desktop.
add_filter('the_content','prepend_this');
function prepend_this($content)
{
$content = '<div class="container" style="background-image: url(\'' . the_post_thumbnail_url() . '\'"><div id="safe-area-back">' . $content;
$content = $content . "</div></div>";
return $content;
}
@InTheCloudDan
Copy link
Author

add_filter('the_content','prepend_this');

function prepend_this($content)
{
    //$url = the_post_thumbnail_url();
    //$content = gettype();
    // Check if we're inside the main loop in a single post page.
    $content = sprintf(
    '<div class="postcard-container" style="background-image: url(\'%s\');"><div id="safe-area-back">%s</div></div>',
    get_the_post_thumbnail(), $content);
    return $content;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment