| 开发者 |
RDV InfoTech
rdvinfotech |
|---|---|
| 更新时间 | 2025年12月13日 02:02 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
<?php if(function_exists('rdv_category_image_url')){ echo rdv_category_image_url(); } ?>
- Use this template tag rdv_category_image(); in the category template file to display the category image directly.
<?php if(function_exists('rdv_category_image')){ rdv_category_image(); } ?>
- Use the shortcode in page or post or a page builder template to display a category image. The basic shortcode without attributes [rdv_category_image] will only work on the category template page to display a specific category image. Use shortcode attributes term_id and size to display a specific category image and size.
[rdv_category_image] [rdv_category_image term_id="10"] [rdv_category_image size="thumbnail"] [rdv_category_image term_id="10" size="thumbnail"]
When you edit a category that has an image, a shortcode automatically appears on the edit page like this: [rdv_category_image term_id="10"]
Simply click the shortcode to copy it to your clipboard, then paste it anywhere on your site (posts, pages, widgets).
Make sure of these three things:
Yes! WooCommerce product categories work automatically:
No, the plugin is lightweight and won't affect your site's performance. It only loads in the admin area when you're editing categories.
No! For most users, you don't need to edit any files. Simply use the shortcode that appears when you edit a category and paste it into:
intval() for image IDs) and improved attribute/URL escaping.plugins_loaded hook for proper WordPress integration.