wordpress snippets last updated   : August 18, 2014
we now have 638 snippets
category media

Set default attachment display settings, alignment, link to, size in wordpress

wordpress snippet

Have you ever wanted to change the default options when inserting media into a post? Setting the default alignment to “left” or the default size to “large” ? This may not appear to be a big deal but if you are constantly changing the settings to the same thing over and over again for each image this is a must have snippet. We are updating the options “image_default_align, image_default_link_type, image_default_size”. Keep in mind that this just changes the default settings of these options within the add media popup. The method we use to update these options can be used for a number of other options including what you can find in this options reference.

read more

Display post attachment count in admin column

wordpress snippet

Sometimes you have a post with multiple attachments and it would be nice to see a count of the total media attached to a post. Adding this snippet to the functions.php of your wordpress theme will display the post attachment count in a custom admin column.

read more

Add a Class to ‘the_post_thumbnail’ a Featured Image

wordpress snippet

When adding a featured image to a template, you may want to add a class to the image tag that is being generated. This extra class will allow you to use CSS to format it better.

read more

Remove image sizes from media upload gallery

wordpress snippet

This snippet will let you remove image sizes from media upload gallery very similar to a recent post that will show you how to add custom image sizes to the media upload gallery.

read more

Require a featured image before you can publish post

wordpress snippet
require-featured-image-can-publish-post

    If you would like to require that all posts have a featured image before they can be published add this snippet to the functions.php of your wordpress theme. When you try and publish a post without a featured image you get an admin message “You must select Featured Image. Your Post is saved but it can not be published.” Great way to ensure all your posts have a featured image before they are publish.

    read more

    Remove buttons from add media popup

    wordpress snippet

    Run into this snippet not to long ago that will let you remove every button from add media popup. This will remove all but the delete button from the media popup so have fun and enjoy.

    read more
    jqsnipp.com | we just launched jquery snippets website