Sometimes you will need to add a custom attribute to an image. This is very easy to do using
the_post_thumbnail() function. The following snippet will add the custom attribute of
'itemprop="image" to your images but you can change that to nearly anything including
class, alt, title etc.
Sometimes you will need to add a custom attribute to an image. This is very easy to do usingRead More...
Have you ever been usingRead More...
the_post_thumbnail( 'thumbnail' );but wanted to remove the class that is automatically added. Add the following snippet to the functions.php of your wordpress theme to automatically remove any class. Simple but effective,
This snippet will display absolutely all custom fields for each post. Even custom fields you may not even be aware exist likeRead More...
_edit_lockand others. We have Justin Sternberg to thank for writing this snippet that was submitted a while ago as part of his tutorial on wordpress custom fields. Since this snippet is not available other than in the tutorial I figure it should be posted separately.
Looking to remove the width and height attributes from images in your posts? Is this because you are using a responsive wordpress theme. Just add this snippet to the functions.php of your wordpress theme and all of the width and height attributes will be removed from your images.Read More...
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...
Simple little snippet that will use a custom fieldRead More...
sponsoredset to true will prepend “‘Sponsored post:” to
the_title. The second snippet will prepend the value of