RDV Category Image

外掛說明

RDV Category Image plugin allows you to add an image to a category, tag, or any custom taxonomies. Please review the code snippets below to display a category image on the category page template or any page or post.

  • Use template tag rdv_category_image_url(); with php echo function to get 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 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"]
    

螢幕擷圖

  • Settings page.
  • Add New Category page.
  • Edit Category page – add image.
  • Edit Category page – shortcode preview.

安裝方式

  1. Go to your admin area and select Plugins and Add New from the menu.
  2. Search for “RDV Category Image”.
  3. Click install.
  4. Click activate.

常見問題集

Where can I find the shortcode for my category?

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).

The image isn’t showing on my site. What should I check?

Make sure of these three things:
1. Go to RDV Category Image settings and verify the taxonomy (Categories, Tags, etc.) is checked and saved
2. Confirm you’ve uploaded an image for that specific category
3. Clear your site cache and refresh the page

Does this work with WooCommerce product categories?

Yes! WooCommerce product categories work automatically:

  1. Go to RDV Category Image settings
  2. Check “Product categories (product_cat)”
  3. Click Save Changes
  4. Edit any product category and upload an image

Use the shortcode displayed on the edit page to show the image anywhere in your store.

Will this plugin slow down my website?

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.

Do I need to edit my theme files to use this plugin?

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:
– Posts or pages (use the full shortcode with term_id)
– Page builder modules (Elementor, Divi, Beaver Builder, etc.)
– Page builder category archive templates

Advanced users who want more control can optionally add template tags to their child theme files – see the template tag examples in the Description section above.

使用者評論

閱讀全部 2 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈RDV Category Image〉的開發相關工作。

參與者

〈RDV Category Image〉外掛目前已有 1 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈RDV Category Image〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.1.0

  • Compatibility: Tested up to WordPress 6.9
  • New: Added shortcode preview on category edit page with click-to-copy functionality.
  • Security: Added nonces and capability checks for term image add/edit.
  • Security: Sanitized inputs (use intval() for image IDs) and improved attribute/URL escaping.
  • Security: Added a sanitize callback for plugin options.
  • Fix: Handled missing/invalid attachments to avoid PHP notices.
  • Enhancement: Refactored JavaScript to eliminate global variables and use targeted event handlers for improved reliability.
  • Enhancement: Initialize plugin on plugins_loaded hook for proper WordPress integration.
  • Tweak: Preselect the existing image in the media modal when editing a category image.
  • Docs: Added FAQ section to readme.txt.

1.0.10

  • Compatibility: Tested up to WordPress 6.8.1
  • Tweak: Minor adjustments to code.

1.0.9

  • Compatibility: Tested up to WordPress 6.5.2
  • Tweak: Minor adjustments to CSS and code.

1.0.8

  • Compatibility: Tested up to WordPress 6.4.2

1.0.7

  • Compatibility: Tested up to WordPress 6.2.2
  • Tweak: Added notice – Settings saved.
  • Tweak: Added categories/taxonomies labels.

1.0.6

  • Compatibility: Tested up to WordPress 6.1.1

1.0.5

  • Compatibility: Tested up to WordPress 6.1

1.0.4

  • Compatibility: Tested up to WordPress 6.0.1

1.0.3

  • Documentation Update

1.0.2

  • Documentation Update

1.0.1

  • Updated documentation

1.0.0

  • The First Release