Home

Whenever there’s something I struggle to find a clear answer for (and eventually figure out myself), I like to post it for those who need help later. This is one of those times.

If you ever wanted to change the ‘Add To Cart’ text on your WooCommerce site, just add in the following code to your functions.php file (or similar):

Don’t forget to change the text to whatever you’d like your button to say!

Snippets, Wordpress    1 year ago      7 Comments   

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.


Download (Version 1.1) – 3939 Downloads

Documentation / Demo

Plugins, Wordpress    1 year ago      64 Comments   

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.

Keep on reading! There’s more…

Snippets, Wordpress    1 year ago      3 Comments   

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.

Keep on reading! There’s more…

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*.

Keep on reading! There’s more…

PHP, Tutorials, Wordpress    1 year ago      4 Comments   

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.

Keep on reading! There’s more…

Easy Digital Downloads, Tips, Wordpress    1 year ago      1 Comment   

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!

Snippets, Tips, Wordpress    1 year ago      Leave a comment