Category link shortcode

The Prodigy Category Link shortcode allows you to display a single category overlay that links to the category page with an option to display the product count and a background image.  This shortcode is demonstrated on our demo home page in the style feed section.

sc-category-link.png

Example Usage

Show a category link with a background image and product count

[prodigy_category_link category_id="1" category_image=
"http://mysite.com/image.jpg" show_count_products="true"]

Available Attributes

category_id

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

[prodigy_category_link category_id="1"]

category_slug

Accepts a single Category Name slug to display.

[prodigy_category_link category_slug="womens-hoodies"]

show_count_products

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

[prodigy_category_link category_id="1" show_count_products="false"]

opacity

Determines the opacity of the overlay with the category link.  Accepts a decimal between 0 and 1.  Default value is 0.5.

[prodigy_category_link category_id="1" opacity="0.4"]

category_image

Specifies the URL of an optional background image.

[prodigy_category_link category_id="1" category_image="http://mysite.com/image.jpg"]

height

Specifies the height in pixels of the background image.  If set to less than the full height of the selected image, part of the image will be hidden (see image_position attribute below).  Value must include "px" at the end.  If height is not specified, the image will be displayed at full height.

[prodigy_category_link category_id="1" height="400px" category_image="http://mysite.com/image.jpg"]

image_position

If the full height of the background image is not being displayed, the image_position specified the positioning of the background image.  Accepted values are:  center, top, bottom.  The default value is center.

[prodigy_category_link category_id="1" image_position="top" height="400px" category_image="http://mysite.com/image.jpg"]

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/category_link_with_image.php
prodigy-commerce/templates/partials/shortcode/category_link_without_image.php

Copy to:

<your-theme>/prodigy/shortcode/category_link_with_image.php
<your-theme>/prodigy/shortcode/category_link_without_image.php

 

Build WordPress stores with modern technology

Sign up to use the Prodigy platform, a powerful alternative to WooCommerce. Prodigy is free at ANY scale.

Create an Account