Linux 软件免费装
Banner图

Product Attributes Shortcode

开发者 ninetyninew
更新时间 2024年11月2日 19:53
WordPress版本: 6.6.2
版权: GNU General Public License v3.0
版权网址: 版权信息

标签

shortcode product attributes product attribute product terms product term

下载

1.9.2 1.5.0 1.2.0 1.3.0 1.7.0 1.8.0 1.9.1 1.9.0 1.0.0 1.4.0 1.9.3 2.0.0 2.0.1 1.1.0 1.6.0

详情介绍:

Provides a shortcode to display a linked list of terms from a product attribute, such as all brand links from a brands attribute. This extension is intended to be used where you want to display all terms from a product attribute, e.g. to display a list of all brands in the footer of your website. It is not intended to be used to display a list of terms associated with a specific product. Features Usage Use the following shortcode replacing the x with your attribute name: [wcpas_product_attributes attribute="x"] If your attribute has spaces in the name then replace these with hyphens in the shortcode, if you have other characters in your attribute name see the related FAQ below. There are various other shortcode attributes which can be used, if these are omitted the defaults are used, the available shortcode attributes are: Example shortcode using multiple shortcode attributes: [wcpas_product_attributes attribute="brand" archive_links="0" categorize="first_character" current_attribute_link="0" hide_empty="0" links_target="_blank" min_price="50.00" max_price="500.00" order="desc" orderby="id" show_counts="1" show_descriptions="1"]

安装:

Before using this product, please ensure you review and accept our terms and conditions and privacy policy. Before using this product on a production website you should thoroughly test it on a staging/development environment, including all aspects of your website and potential data volumes, even if not directly related to the functionality the product provides. The same process should also be completed when updating any aspect of your website in future, such as performing installations/updates, making changes to any configuration, custom web development, etc. Always refer to the changelog before updating. Installation Please see this documentation. Updates Please see this documentation. Minimum Requirements BETA Functionality We may occasionally include BETA functionality, this is highlighted with a (BETA) label. Functionality with this label should be used with caution and is only recommended to be tested on a staging/development environment. The functionality is included so users can test the functionality/provide feedback before it becomes stable, at which point the (BETA) label will be removed. Note that there may be occasions where BETA functionality is determined unsuitable for use and removed entirely. Caching If you are using any form of caching then it is recommended that the cache lifespan/expiry should be set to 10 hours or less. This is recommended by most major caching solutions to avoid potential issues with WordPress nonces. Screen Sizes Translation We generally recommend Loco Translate to translate and/or adapt text strings within this product. Works With Where we have explicitly stated this product works with another product, this should only be assumed accurate if you are using the version of the other product which was the latest at the time the latest version of this product was released. This is because, while usually unlikely, the other product may have changed functionality which effects this product.

屏幕截图:

  • Shortcode display with categorize option used
  • Shortcode display with various additional options used
  • Shortcode added via block

常见问题:

Nothing is displaying?

Ensure you have included the shortcode correctly and that the attribute you are using has products assigned. If nothing is still displaying the attribute name you have entered may not be in the correct format, see the related FAQ for more information.

What attribute name/format do I use?

If your attribute is a single word you just need to enter that. If your attribute has spaces in the name, replace these with hyphens in the shortcode attribute. For more complex attribute names e.g. with special characters you can determine what the attribute name is by editing the attribute in Products > Attributes, in the URL you will see something like /edit-tags.php?taxonomy=pa_example-attribute&post_type=product, the part after the pa_ and before the & is your attribute name, in this example it is example-attribute.

Why aren't my list of terms linked?

The list will not include links on the terms if you are using archive_links="1" and the attribute used does not have archives enabled on the attribute which is set when editing the attribute in Products > Attributes .

My list of terms are linked but the links do not work?

Links are filter based which use your shop page (unless you are using archive_links="1"), if they are not working you may have not configured a shop page in WooCommerce, this is created during installation of WooCommerce, if it has been removed it will need recreating.

Minimum/maximum price is not working?

These are filter based and therefore require archive_links="0".

Can I split the list of terms up?

Use the categorize shortcode attribute as described in the usage information above.

Can I use it in a page, post, widget, block, etc?

You can use it anywhere you can use a shortcode.

Can I use it in a PHP template?

Yes, use the do_shortcode function of WordPress to echo the shortcode.

How can I display it as a horizontal list rather than a bullet list?

The output is based on a <ul> element, however you can use some custom CSS to make the <ul> list display horizontally, and optionally with a separating character, such as a comma. See this custom CSS example. If using the categorize shortcode attribute the linked example will need some additional custom CSS rules due to the additional category markup it includes.

How do I style it?

We intentionally do not add any default styling to keep the extension as simple/lightweight as possible and to reduce the need to override any default CSS styles. If you wish to add your own styling, you will need to apply some custom CSS styling, each shortcode used outputs a parent <ul> element containing child elements. All elements have classes and IDs for custom CSS styling purposes.

更新日志:

2.0.2 - 2024-11-02 2.0.1 - 2024-08-23 2.0.0 - 2024-07-18 1.9.3 - 2024-07-09 1.9.2 - 2024-04-10 1.9.1 - 2024-03-08 1.9.0 - 2024-01-16 1.8.0 - 2023-12-18 1.7.0 - 2023-09-19 1.6.0 - 2023-08-02 1.5.0 - 2022-10-22 1.4.0 - 2022-04-23 1.3.0 - 2022-03-25 1.2.0 - 2021-07-16 1.1.0 - 2021-05-12 1.0.0 - 2021-05-11