前言介紹
- 這款 WordPress 外掛「Custom Posts Accordion」是 2016-08-31 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2020-02-03,距離現在已有 1916 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 4.9.8 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
Accordion | custom post |
內容簡介
此外掛可從自訂文章中創建基本手風琴。
與WPML完全相容,只需翻譯您的文章並使用下面說明的短代碼。
此外掛目前不支援Woocommerce。
使用說明
要使用此外掛,您需要註冊自訂文章。
您可以查看文章類型以了解如何進行設置。
以下是WP Codex的示例 - 如需測試,將下面的代碼複製貼上到佈景功能文件。
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'Accordion',
array(
'labels' => array(
'name' => __( '手風琴' ),
'singular_name' => __( '手風琴' )
),
'public' => true,
'has_archive' => true,
)
);
}
在您想要使用手風琴的頁面或文章中添加短代碼
如果您使用以上代碼創建自訂文章類型,則可以使用以下短代碼:
[gw_accordion post_type="Accordion"]
也可以添加CSS類別
[gw_accordion post_type="Accordion" class="my_css_class"]
您還可以將代碼添加到主題中
或者帶有CSS類別
您還可以設置排序,默認按ID升序排列
[gw_accordion post_type=”Accordion” class=”my_css_class” order_by=”title” order=”asc”]
演示
查看演示
已知問題
如果您的主題使用類似於此的平滑滾動腳本
jQuery(function() {
jQuery('a[href*="#"]:not([href="#"]').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = jQuery(this.hash);
target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']');
if (target.length) {
jQuery('html,body').animate({
scrollTop: target.offset().top
}, 2000);
return false;
}
}
});
});
您可能需要更改此行
jQuery('a[href*="#"]:not([href="#"]')
讓它看起來像這樣
jQuery('a[href*="#"]:not([href="#"], a:not([data-toggle])')
避免衝突。
原文外掛簡介
This plugin creates a basic accordion from custom posts.
Fully compatible with WPML, just translate your posts and use shortcodes as explained below.
The plugin currently does not support Woocommerce.
How to use
To use this plugin you need custom post registered.
You may check Post Types to see how to do it.
Example from WP Codex – for testing, copy and paste code below to theme functions.php
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'Accordion',
array(
'labels' => array(
'name' => __( 'Accordions' ),
'singular_name' => __( 'Accordion' )
),
'public' => true,
'has_archive' => true,
)
);
}
Add shortcode to page or post where you want to use accordion
If you used code above to create custom posts type you would use following shortcode:
[gw_accordion post_type="Accordion"]
Optionally, you may add CSS class
[gw_accordion post_type="Accordion" class="my_css_class"]
You can also add code to your theme
or with the CSS class
You also may set ordering, default is by ID and Ascending (ASC)
[gw_accordion post_type=”Accordion” class=”my_css_class” order_by=”title” order=”asc”]
Demo
Check Demo
Known Issues
If your theme uses smooth scroll script like this one
jQuery(function() {
jQuery('a[href*="#"]:not([href="#"]').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = jQuery(this.hash);
target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']');
if (target.length) {
jQuery('html,body').animate({
scrollTop: target.offset().top
}, 2000);
return false;
}
}
});
});
You may need to change this line
jQuery('a[href*="#"]:not([href="#"]')
To look like this
jQuery('a[href*="#"]:not([href="#"], a:not([data-toggle])')
to avoid conflict
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Custom Posts Accordion」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Collapse-O-Matic 》Collapse-O-Matic 外掛會新增一個 [expand] 短碼,將任何內容(包括其他短碼)包裹成一個可展開和折疊的手風琴元素。此外,還提供完整的短碼選項和屬性演示清...。
Accordion FAQ – Compatible With All Page Builder (Elementor, Gutenberg) 》感謝使用我們的外掛。如果需要一個很棒的手風琴常見問題解答(FAQ)外掛,那就是它了。Responsive Accordion 備有 WordPress 的優秀手風琴 FAQ 建構工具,您...。
Shortcodes by Angie Makes 》Shortcodes by Angie Makes 外掛為您的 WordPress 主題新增一系列易於使用的短碼,這些短碼與 Angie Makes WordPress 主題 完美搭配。, 範例, 請到此查看這些...。
Read More & Accordion 》Read More 是最好的 WordPress 閱讀更多外掛,協助您顯示或隱藏長篇內容。, 透過 Read More 外掛,您可以使內容較長的網站更美觀。在插入簡碼後,您不想立即...。
Accordion – AI FAQ, Accordion, Tabs, Image Accordion, Product FAQ, FAQ Builder, FAQ Grid 》ided index, Accordion 外掛, Accordions 是一個簡單且功能強大的工具,可用於創建手風琴、常見問題解答、標籤、標籤內容、常見問題、知識庫、問答區段、WooC...。
Accordion Blocks 》Accordion Blocks 是一個簡單的外掛程式,可為您的頁面新增如手風琴般的下拉式選單的 Gutenberg 區塊。, 手風琴選單可以與您的佈景主題無縫結合。不過,您可...。
Tabby Responsive Tabs 》, 增加一組水平標籤,在較窄的視窗時會變成手風琴, 使用 jQuery 建立標籤和手風琴, 支援同一頁面多組標籤, 使用語意化的標題和內容標記, Aria 屬性和角色有助...。
Lightweight Accordion 》這是一個輕量級的手風琴 WordPress 外掛,可以使用 Gutenberg 區塊或經典編輯器中的簡短代碼,在文章中添加可折疊元素。通過使用 details HTML 標籤和幾行 CS...。
FAQ / Accordion / Docs / KB – Helpie WordPress FAQ Accordion plugin 》Helpie FAQ 是一個先進的 WordPress 常見問題解答外掛,可以輕鬆地在 WordPress 網站上創建、編輯和嵌入常見問題解答和手風琴。您可以輕鬆地創建驚人的手冊頁...。
Bellows Accordion Menu 》Bellows 是一個讓 WordPress 網站擁有漂亮手風琴選單的外掛,它可以運用 WordPress 的選單系統讓你建立出美麗的手風琴選單。, Bellows Lite Demo, Bellows Fu...。
Accordion Shortcodes 》Accordion Shortcodes 是一個簡單的外掛,它添加了幾個簡短代碼,可在頁面中添加手風琴下拉菜單。手風琴將無縫融入主題中,但您可能希望編輯主題的樣式表以添...。
Olevmedia Shortcodes 》Olevmedia Shortcodes 外掛在編輯器中新增了一個按鈕,提供了許多方便的短碼:, , 手風琴, 開關, 標籤頁(響應式), 引言, 方框, 按鈕(您可以選擇圖示、顏色...。
Magee Shortcodes 》Magee 短代码是一款提供一系列短代码的 WordPress 外掛。它基於 Bootstrap 平台編寫,使用 HTML5 和 CSS3 語言編寫,可以在桌面和移動設備上實現完全響應式。...。
Arconix FAQ 》這款外掛可以讓您輕鬆創建時尚的常見問題解答區,並透過提供的簡碼([faq])顯示您的常見問題解答,使用動畫的 jQuery 切換或手風琴折疊框來顯示/隱藏它們。 ...。
Advanced Accordion Gutenberg Block 》Advanced Accordion Gutenberg Block 是一個自定義的原生 Gutenberg 區塊,允許您在網站文章和頁面上使用 Gutenberg 編輯器輕鬆構建常見問題解答部分或手風琴...。