I came across this great snippet after some extensive searching and just wanted to share it to avoid others having to search long and hard just to find it. Authored by TheDeadMedic over on Stack Overflow, inserting the following into your
functions.php file will exclude the_post_thumbnail or featured image of a post from its gallery:
I came across this awesome snippet the other day that I thought I’d share and expand on it a little bit.
When you want to rename the title of a meta box, custom or core, the best way is to remove that meta box and then re-add it with a new title, using something like this:
You’ll need to change the fields above though for:
- METABOX_ID – eg. commentsdiv. See below for full list.
- META BOX TITLE – Whatever you’d like to rename the meta box.
- METABOX_CALLBACK – eg. post_thumbnail_meta_box – See below for full list.
- POST_TYPE – eg. post, page, etc.
This is such a cool little snippet. It’ll allow you to add a custom image size that you’ve added using <?php add_image_size() ?> to the media insert pop-up, so your custom image sizes can be inserted into posts as well as used through <?php the_post_thumbnail(); ?>.
Just add the following to your functions.php file:
Adjust as needed!
Quick little snippet here that may come in hand. If you’d like to add support for excerpts for a download when using Easy Digital Downloads, just add the following code to your functions.php:
You’ll then see the Excerpt meta box appear on the edit screen for downloads! You can output it using <?php the_excerpt(); ?>.