[WordPress] 外掛分享: Child Pages Card

首頁外掛目錄 › Child Pages Card
60+
安裝啟用
★★★★
4/5 分(2 則評價)
113 天前
最後更新
問題解決
WordPress 6.6+ PHP 8.0+ v2.07 上架:2019-11-09

內容簡介

指定父頁面的 ID,以卡片形式顯示子頁面存檔

使用 shortcode 生成
使用區塊生成
可以按升序或降序排序
指定從文本中提取的字符數,顯示摘要
顯示特色圖片。如果沒有特色圖片,則顯示網站圖標,如果沒有網站圖標,則顯示 WordPress 圖標
可以指定顯示圖片的大小

它的運作原理

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.07) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Child Pages Card」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Displays child page archives in card form

Generated with shortcode
Generated with block
Can sort in ascending order and descending order.
Specify the number of characters from the text and display the excerpt.
Displays an featured image. If there is no featured image, a site icon is displayed, and if there is no site icon, a WordPress icon is displayed.
Can specify the size of the displayed image.

How it works

Customize

Template files allow for flexible customization.
The default template file is template/childpagescard-template-html.php and template/childpagescard-template-css.php. Using this as a reference, you can specify a separate template file using the filters below.

/** ==================================================
* Filter for template file of html.
*
*/
add_filter(
'child_pages_card_generate_template_html_file',
function () {
$wp_uploads = wp_upload_dir();
$upload_dir = wp_normalize_path( $wp_uploads['basedir'] );
$upload_dir = untrailingslashit( $upload_dir );
return $upload_dir . '/tmp/childpagescard-template-html.php';
},
10,
1
);

/** ==================================================
* Filter for template file of css.
*
*/
add_filter(
'child_pages_card_generate_template_css_file',
function () {
$wp_uploads = wp_upload_dir();
$upload_dir = wp_normalize_path( $wp_uploads['basedir'] );
$upload_dir = untrailingslashit( $upload_dir );
return $upload_dir . '/tmp/childpagescard-template-css.php';
},
10,
1
);

CSS files can be set separately. Please see the filters below.

/** ==================================================
* Filter for CSS file.
*
*/
add_filter(
'child-pages-card_css_url',
function () {
$wp_uploads = wp_upload_dir();
$upload_url = $wp_uploads['baseurl'];
if ( is_ssl() ) {
$upload_url = str_replace( 'http:', 'https:', $upload_url );
}
$upload_url = untrailingslashit( $upload_url );
return $upload_url . '/tmp/childpagescard.css';
},
10,
1
);

延伸相關外掛

文章
Filter
Apply Filters
Mastodon