內容簡介
讓你的媒體插入代碼在整個網站中保持一致。
自訂整個網站的影像和媒體 HTML 代碼
使用 [media] 短碼於特定大小展示圖片庫中的圖片
移除 WordPress 的過度自動代碼,例如 class=””
強制 WordPress 插入相對網址,以方便在開發伺服器上進行測試
短碼文件
使用 [media] 短碼輕鬆顯示圖片庫中的圖片。以下是一些使用範例:
顯示三張圖片。排序由 WordPress 媒體庫決定:
[media] [media] [media]
顯示 ID 為 123 的影像:
[media id=”123″]
顯示縮圖、中等或大型影像:
[media size=”small”]
[media size=”medium”]
[media size=”large”]
顯示可點擊的影像。點選連結 URL 將預設為該影像的 WordPress「檢視頁面」。
[media link=true]
顯示可點擊的影像,並鏈結到任意 URL:
[media link=true url=”http://www.your-custom.url”]
設定自訂 class、標題、寬度或高度屬性範例。這些可以用於客製生成的 HTML 影像標籤屬性。
[media class=”custom-class” title=”title text” width=”100″ height=”100″]
外掛標籤
開發者團隊
原文外掛簡介
Keep your media insert code consistent site-wide.
Customize image and media HTML code site-wide
Use the [media] shortcode to display images from the gallery at particular sizes
Remove overbearing WordPress auto-code like class=””
Force WordPress to insert relative URLs to make testing on a dev server easier
Shortcode Documentation
Use the [media] shortcode to easily display images from the gallery. Here are some example uses:
Display 3 images from the gallery. The order is determined in the WordPress media gallery:
[media] [media] [media]
Display an image with id 123:
[media id=”123″]
Display a thumbnail, medium, or large sized image:
[media size=”small”]
[media size=”medium”]
[media size=”large”]
Display a clickable image. The click through URL will default to the WordPress “view page” for that image.
[media link=true]
Display a clickable image, linking to an arbitrary URL:
[media link=true url=”http://www.your-custom.url”]
Examples for setting custom class, title, width, or height attributes. These can be used to customzie the attributes on the generated HTML image tag
[media class=”custom-class” title=”title text” width=”100″ height=”100″]
