| 开发者 |
RDV InfoTech
rdvinfotech |
|---|---|
| 更新时间 | 2026年6月26日 23:29 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
rdv_category_image_url(); with the PHP echo function to retrieve the category image URL, and then use it in an image tag.<?php if(function_exists('rdv_category_image_url')){ echo rdv_category_image_url(); } ?>
- Use the 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 a page, post, or page builder template to display a category image. The basic shortcode without attributes [rdv_category_image] displays the image on a category archive page. Use the shortcode attributes term_id and size to display a specific category image and size on any page or post.
[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).
Please check these three items:
Yes! WooCommerce product categories are fully supported:
No, the plugin is lightweight and will not affect your site's performance. It only loads administrative scripts on relevant category edit screens.
No! Editing files is not required for most users. Simply use the shortcode that appears when editing a category and paste it into:
term_id attribute).return; pattern.absint( wp_unslash(...) ).manage_options for consistency with settings access.function_exists checks to prevent conflicts.Settings saved successfully.) on the plugin settings page.Add Image and Change Image button labels.intval() for image IDs) and improved attribute/URL escaping.plugins_loaded hook for proper WordPress integration.