Categories shortcode

The Prodigy Categories shortcode allows you to display a list of specific product categories in either a slider or grid view.  This shortcode is demonstrated on our demo home page in the browse our categories section.

sc-categories-slider.png

Example Usage

Show specific categories by ID with ordering by title

[prodigy_categories category_ids="1,2,3" orderby="title" order="ASC"] 

Show the first four child categories of a specific parent category in grid view

[prodigy_categories parent_ids="1" display="grid" limit="4"]

Available Attributes

category_ids

Accepts a list of comma separated Category IDs to display.  You can find the Category IDs in the WordPress Admin by navigating to Prodigy -> Categories and looking for the ID column.

[prodigy_categories category_ids="1,2,3"]

category_slugs

Accepts a list of comma separated Category Name slugs to display

[prodigy_categories category_slugs="men, women"]

parent_ids

Accepts a list of comma separated Category IDs and displays all of their child categories

[prodigy_categories parent_ids="1,2"]

limit

Limits the number of categories returned.  For example, if the other attributes specified in the shortcode match 8 categories and the limit attribute is set to 4, then only the first 4 matching categories will be displayed.

[prodigy_categories limit="4"]

columns

Determines the number of category columns per row that will be displayed.  The default value is 4 columns per row if not specified.

[prodigy_categories columns="3"]

orderby

Allows you specify the order in which the categories will be displayed.  Acceptable values are: id, title.  Default value is id.

[prodigy_categories orderby="title"]

order

Determines if the sort order will be ascending or descending.  Acceptable values are: ASCDESC.  Default value is ASC.

[prodigy_categories orderby="title" order="DESC"]

show_product_count

Determines if the count of products will be shown in the image overlay.  Acceptable values are:  truefalse.  Default value is true.

[prodigy_categories show_product_count="false"]

display

Determines if categories will be displayed in slider or grid view.  Acceptable values are:  slidergrid.  Default value is slider.

[prodigy_categories display="grid"]

Template Override

The template used by this shortcode can be overridden by copying the template into your theme or child theme and then editing.

Copy from:

prodigy-commerce/templates/partials/shortcode/categories.php
prodigy-commerce/templates/partials/shortcode/categories_grid.php

Copy to:

<your-theme>/prodigy/shortcode/categories.php
<your-theme>/prodigy/shortcode/categories_grid.php