
內容簡介
Display Terms Shortcode外掛是為了讓使用者能夠輕鬆地顯示詞彙列表,而不需了解PHP或編輯樣板文件而開發的。
在文章、頁面或小工具中添加shortcode,並使用引數基於標籤、分類、文章類型等進行查詢。您還可以使用包括include、child_of和show_image在內的引數自定義輸出。
要使用shortcode,只需在任何文章、頁面或小工具中放置[display-terms] shortcode,並根據您的喜好更改引數。
可用的引數(與默認值):
taxonomy => 'category'
orderby => 'name'
order => 'ASC'
hide_empty => true
include => 'all'
exclude => 'all'
exclude_tree => 'all'
number => false
offset => ''
fields => 'all'
name => ''
slug => ''
hierarchical => true
search => ''
name__like => ''
description__like => ''
pad_counts => false
get => ''
child_of => false
childless => false
cache_domain => 'core'
update_term_meta_cache => true
meta_query => ''
meta_key => array()
meta_value => ''
show_link => true
show_name => true
show_description => false
show_count => false
show_image => true
image_size => 'full'
post_type => 'post',
post_include => [],
post_exclude => [],
post_order => 'DESC',
post_orderby => 'modified',
number_to_search => 10,
parent_element => 'ul',
child_element => 'li',
class_prefix => 'terms',
可用的篩選器
此外掛的每行輸出都會通過篩選器。
display_terms_shortcode_open
display_terms_shortcode_inner_open
display_terms_shortcode_link_open
display_terms_shortcode_name
display_terms_shortcode_description
display_terms_shortcode_count
display_terms_shortcode_latest
display_terms_shortcode_image_id
display_terms_shortcode_image
display_terms_shortcode_link_close
display_terms_shortcode_inner_close
display_terms_shortcode_close
display_terms_shortcode_output
特色圖像
如果將show_image引數設置為true,shortcode將尋找該詞彙中最新文章的特色圖像。您可以使用image_size屬性更改特色圖像的大小。
貢獻
歡迎在此外掛的Github倉庫(https://github.com/seothemes/display-terms-shortcode/)中提出功能建議和拉取請求。
在提交拉取請求之前,請運行translatio(?)。
外掛標籤
開發者團隊
原文外掛簡介
The Display Terms Shortcode was written to allow users to easily display listings of terms without knowing PHP or editing template files.
Add the shortcode in a post, page or widget and use the arguments to query based on tag, category, post type, and many other possibilities. You can also customize the output with parameters like: include, child_of, and show_image.
To use the shortcode, simply place the [display-terms] shortcode in any post, page or widget and change the parameters to your liking.
Available parameters (and defaults):
taxonomy => ‘category’
orderby => ‘name’
order => ‘ASC’
hide_empty => true
include => ‘all’
exclude => ‘all’
exclude_tree => ‘all’
number => false
offset => ”
fields => ‘all’
name => ”
slug => ”
hierarchical => true
search => ”
name__like => ”
description__like => ”
pad_counts => false
get => ”
child_of => false
childless => false
cache_domain => ‘core’
update_term_meta_cache => true
meta_query => ”
meta_key => array()
meta_value => ”
show_link => true
show_name => true
show_description => false
show_count => false
show_image => true
image_size => ‘full’
post_type => ‘post’,
post_include => [],
post_exclude => [],
post_order => ‘DESC’,
post_orderby => ‘modified’,
number_to_search => 10,
parent_element => ‘ul’,
child_element => ‘li’,
class_prefix => ‘terms’,
Available filters
Every line of output in this plugin runs through a filter.
display_terms_shortcode_open
display_terms_shortcode_inner_open
display_terms_shortcode_link_open
display_terms_shortcode_name
display_terms_shortcode_description
display_terms_shortcode_count
display_terms_shortcode_latest
display_terms_shortcode_image_id
display_terms_shortcode_image
display_terms_shortcode_link_close
display_terms_shortcode_inner_close
display_terms_shortcode_close
display_terms_shortcode_output
Featured images
If the show_image parameter is set to true, the shortcode will look for the featured image of the latest post in the term. You can change the size of the featured image with the image_size attribute.
Contributing
Feature suggestions and pull requests are welcome at this plugins Github repository – https://github.com/seothemes/display-terms-shortcode/
Before submitting a pull request please run translations using the following command (wp cli required):
wp i18n make-pot ./ ./languages/display-terms-shortcode.pot
