Created
November 15, 2015 15:42
-
-
Save ThierryA/53bffb0f01372985d36e to your computer and use it in GitHub Desktop.
Beans: set post default image.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not include the opening php tag if it is already included in your file. | |
add_action( 'beans_post_body', 'beans_child_default_post_image', 5 ); | |
function beans_child_default_post_image() { | |
// Stop here if the post has an image set. | |
if ( has_post_thumbnail() ) | |
return; | |
// You may use beans_edit_image() if you need to create multiple size on the fly. | |
echo '<img src="' . get_stylesheet_directory_uri() . '/images/your-default-image.jpg" alt="">'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment