
內容簡介
這個外掛讓您更容易為不同平台包括類別 / 自訂分類法圖像,無需使用高像素圖像大小來超載移動帶寬。 現在您可以為不同的裝置選擇不同的圖像。
文檔
$taxonomy_img = get_taxonomy_image( int $term_id = get_queried_object()->term_id , boolean $return_img_tag = false , array $class = array() );
如果 $return_html = true,則獲取分類法圖像URL,然後返回標籤
參數:
$term_id
(int) (必填)該學期所屬的分類法ID。
$return_img_tag
(boolean) (可選)用於在輸出期間將格式化的圖像與標籤匹配。
$class
(array) (可選)圖像類別的陣列,例如:array('class1','class2',...),但返回圖像標籤為true時應該添加圖像類別。
echo $taxonomy_img; // 分類法圖像URL
其中 $term_id 是 ‘類別 / 學期 ID’
功能
啟用不同分類法的自定義圖像上傳選項
啟用不同設備的自定義圖像上傳選項
非常容易使用和 WP 預設媒體上傳以上傳圖像
內置模板標籤,可在您的主題模板中使用
有興趣為拖放菜單項目做出貢獻嗎?
請通過 sagorh672(at)gmail(dot)com 聯繫我
外掛標籤
開發者團隊
② 後台搜尋「Advanced Category and Custom Taxonomy Image」→ 直接安裝(推薦)
原文外掛簡介
Now its easier to include category / custom taxonomy image with this plugin for different platforms. No need to overload mobile bandwidth with high pixel image size. You can now select different image for different devices. Upload Different Image For Different Devices ex: Mobile, Tablet, Desktop, iOS, Android, Windows Phone.
Built-in Template Tag To Use Anywhere You Want In Your Theme : get_taxonomy_image( $term_id, $return_img_tag, $class );
Documentation
$taxonomy_img = get_taxonomy_image( int $term_id = get_queried_object()->term_id , boolean $return_img_tag = false , string $class = '' );
get taxonomy image url if $return_html = true then return tag
Parameters :
$term_id
(int) (Required) Taxonomy ID of the term.
$return_img_tag
(boolean) (Optional) Formatted Image with tag for the field during output.
$class
(string) (Optional) A space separated string of CSS classes to add to the tag. classes ex: "your custom class list separated by space" but $return_img_tag should be true to add image class.
echo $taxonomy_img; // taxonomy image url
where $term_id is ‘category / term id’
Shortcode : use the shortcode anywhere to get taxonomy image. If you don’t provide “term_id” value then it will be current queried page taxonomy automatically.
echo do_shortcode( '[ad_tax_image term_id="" return_img_tag="true" class="your custom class list seperated by space"]' ); // keep term_id empty if you want to show current visited taxonomy archive image.
Features
Option To Enable Custom Image Upload for different taxonomies
Option To Enable Custom Image Upload for different devices
Very simple to use & WP Default Media Uploaded to upload image
Built-in Template Tag to use in your theme template
Shortcode to use anywhere.
