Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying WooCommerce Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
WooCommerce Cookbook

WooCommerce Cookbook

By : Rauland
3.4 (12)
close
close
WooCommerce Cookbook

WooCommerce Cookbook

3.4 (12)
By: Rauland

Overview of this book

If you have ever built or managed a WordPress site and want to add e-commerce functionality into your site, WooCommerce and this book are perfect for you. Learning how to use WooCommerce through this series of recipes will give you a solid platform to add any future e-commerce needs.
Table of Contents (12 chapters)
close
close
11
Index

Displaying an image on the category archive page

Each category page in WooCommerce looks the same, with of course the exception of the products in that category. This works great for a lot of merchants. However, some merchants like to differentiate their categories—maybe add a banner at the top of the category page to help users see at a glance what they're looking at, or some other customization.

By building on our knowledge of hooks from the preceding recipe, we can add an action onto an existing hook and display a category image.

Getting ready

You need at least one product and it needs to belong to a category. You should also have an image to represent that category.

How to do it…

In the following steps, we're going to start off with something really easy. WooCommerce allows you to upload an image for a category, but it doesn't display it anywhere by default. Once we get the image uploaded, then we can add some code to display it:

  1. From the WordPress admin, go to...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete