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’m now occasionally writing tutorials over on Wptuts+!
My first tutorial was released yesterday, Adding a Responsive jQuery Slider to Your WordPress Theme, which takes you through all the steps needed to do so.
Check it out and if you have any questions/thoughts, leave them there!
I decided to put together a small little WordPress plugin today, using the incredible fancyBox jquery lightbox.
It’s called Light, and it’s just that: a Lightbox and a light-weight plugin. No settings or detailed instructions or anything like that. Just install it and it works.
Want to see a demo? Cool. Here you go.
It’s actually pretty flexible, so I wrote a whole lot of documentation for it over on Captain Theme. You can view the documentation for it there.
Regarding the License, I personally don’t care what you do with the plugin but fancyBox is under a Creative Commons License that basically allows you to use it in personal/non-commercial projects for free but you have to pay if it’s for a commercial site (and you should – it’s well worth the money and the developer deserves it!). Read more about the fancyBox License.
It’s also on GitHub! How exciting. Check out the GitHub repository.
Have a question or need help? Leave it below and I’ll try to answer it.
Documentation / Demo
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.
In Easy Digital Downloads, by default the Checkout page uses the
page.php page template to generate the page. However, there are a few things you can do to customize the page.
Firstly, you can customize the layout of the checkout shopping cart by creating a template for it. In your theme create a folder called edd_templates and in there create a file called
checkout_cart.php. Copy into that file the code from here.
It might look a little daunting at first but play around with this file as it enables you to completely customize the shopping cart’s layout and design just like you would any other theme template file.
When I struggle to find a clear answer to something and eventually come up with something that works, I like to repost it here so others can hopefully save themselves some time. This is one of those times.
If you want to display a random string from an array in WordPress, such as a random quote from a collection of your favourites, I’m going to show you how. Note that this isn’t a WordPress-specific solution, but I like WordPress and I like when you do too so I’m going to assume you’re using it*.
Recently when developing a site powered by Easy Digital Downloads, I wanted one of my products to display differently from the others in the store.
When this problem arises with pages, we can easily create a page template to solve the problem. However, when it comes to creating custom templates for other items such as posts and custom post types, we need a plugin. That’s where the incredible Custom Post Template plugin by Simon Wheatley comes in. By installing the plugin you can easily create templates for your posts, but what about for downloads? Also very easy due to the extensible nature of the Custom Post Template plugin.