{"id":33929,"date":"2019-03-04T08:53:54","date_gmt":"2019-03-04T08:53:54","guid":{"rendered":"http:\/\/getshortcodes.com\/?post_type=docs&#038;p=33929"},"modified":"2023-02-24T15:02:09","modified_gmt":"2023-02-24T15:02:09","slug":"accordion","status":"publish","type":"docs","link":"https:\/\/getshortcodes.com\/docs\/accordion\/","title":{"rendered":"Accordion"},"content":{"rendered":"\n<p class=\"has-black-color has-light-background-color has-text-color has-background\">This shortcode has additional styles available in <a href=\"\/pricing\/\">Shortcodes Ultimate Pro<\/a><\/p>\n\n\n<div class=\"block-demo block-demo-default-details\">\n\t<div class=\"block-demo-viewport\">\n\t\t<p><strong>Single Spoiler<\/strong><\/p>\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\">\n<div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Spoiler title<\/div>\n<div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> Hidden content <\/div>\n<\/div>\n<p><strong>Multiple Spoilers wrapped with Accordion<\/strong><\/p>\n<div class=\"su-accordion su-u-trim\">\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\">\n<div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Spoiler title<\/div>\n<div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> Hidden content <\/div>\n<\/div>\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\">\n<div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Spoiler title<\/div>\n<div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> Hidden content <\/div>\n<\/div>\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\">\n<div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Spoiler title<\/div>\n<div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> Hidden content <\/div>\n<\/div>\n<\/div>\n\t<\/div>\n\t<details class=\"block-demo-source\">\n\t\t<summary>Get the code<\/summary>\n\t\t<pre contenteditable=\"true\">&lt;strong&gt;Single Spoiler&lt;\/strong&gt;\n\n<div class=\"su-spoiler su-spoiler-style-&quot;fancy&quot; su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>&quot;Spoiler<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> Hidden content <\/div><\/div>\n\n&lt;strong&gt;Multiple Spoilers wrapped with Accordion&lt;\/strong&gt;\n\n<div class=\"su-accordion su-u-trim\">\n<div class=\"su-spoiler su-spoiler-style-&quot;fancy&quot; su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>&quot;Spoiler<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> Hidden content <\/div><\/div>\n<div class=\"su-spoiler su-spoiler-style-&quot;fancy&quot; su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>&quot;Spoiler<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> Hidden content <\/div><\/div>\n<div class=\"su-spoiler su-spoiler-style-&quot;fancy&quot; su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>&quot;Spoiler<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> Hidden content <\/div><\/div>\n<\/div><\/pre>\n\t<\/details>\n<\/div>\n\n\n<p class=\"h2\">Table of contents<\/p>\n\n<ol><li><a href=\"#description\">Description<\/a><\/li><li><a href=\"#options\">Options<\/a><ol><li><a href=\"#su_accordion-container\"><div class=\"su-accordion su-u-trim\"><\/div> \u2013 container<\/a><\/li><li><a href=\"#su_spoiler-single-spoiler\"><div class=\"su-spoiler su-spoiler-style-default su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Spoiler title<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"><\/div><\/div> \u2013 single spoiler<\/a><\/li><\/ol><\/li><li><a href=\"#if-accordion-doesnt-work\">If accordion doesn't work<\/a><\/li><li><a href=\"#related-articles\">Related articles<\/a><\/li><\/ol><\/li><\/ol>\n\n\n<h2 class=\"wp-block-heading\" id=\"description\">Description<\/h2>\n\n\n\n<p>This shortcode allows you to create blocks with hidden content - spoilers (toggles). Hidden content will be shown when the block title will be clicked. You can specify different icons or even use different styles for each spoiler.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"options\">Options<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"su_accordion-container\"><div class=\"su-accordion su-u-trim\"><\/div> \u2013 container<\/h3>\n\n\n\n<figure class=\"wp-block-table c-shortcode-options\"><table><tbody><tr><td><a name=\"option-class\" href=\"#option-class\">class<\/a><\/td><td>Additional CSS class name(s) separated by space(s)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"su_spoiler-single-spoiler\"><div class=\"su-spoiler su-spoiler-style-default su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Spoiler title<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"><\/div><\/div> \u2013 single spoiler<\/h3>\n\n\n\n<figure class=\"wp-block-table c-shortcode-options\"><table><tbody><tr><td><a name=\"option-title\" href=\"#option-title\">title<\/a><\/td><td>Text in spoiler title<br><br><strong>Default value:<\/strong> <code>Spoiler title<\/code><\/td><\/tr><tr><td><a name=\"option-open\" href=\"#option-open\">open<\/a><\/td><td>Is spoiler content visible by default<br><br><strong>Possible values:<\/strong> <code>yes<\/code> or <code>no<\/code><br><br><strong>Default value:<\/strong> <code>no<\/code><\/td><\/tr><tr><td><a name=\"option-style\" href=\"#option-style\">style<\/a><\/td><td>Spoiler style<br><br><strong>Possible values:<\/strong><br><code>default<\/code><br><code>fancy<\/code><br><code>simple<\/code><br><code>carbon<\/code><br><code>sharp<\/code><br><code>grid<\/code><br><code>wood<\/code><br><code>fabric<\/code><br><code>modern-dark<\/code> (Modern: Dark)<br><code>modern-light<\/code> (Modern: Light)<br><code>modern-violet<\/code> (Modern: Violet)<br><code>modern-orange<\/code> (Modern: Orange)<br><code>glass-dark<\/code> (Glass: Dark)<br><code>glass-light<\/code> (Glass: Light)<br><code>glass-blue<\/code> (Glass: Blue)<br><code>glass-green<\/code> (Glass: Green)<br><code>glass-gold<\/code> (Glass: Gold)<br><br><strong>Default value:<\/strong> <code>default<\/code><\/td><\/tr><tr><td><a name=\"option-icon\" href=\"#option-icon\">icon<\/a><\/td><td>Icons for spoiler<br><br><strong>Possible values:<\/strong><br><code>plus<\/code><br><code>plus-circle<\/code> (Plus circle)<br><code>plus-square-1<\/code> (Plus square 1)<br><code>plus-square-2<\/code> (Plus square 2)<br><code>arrow<\/code><br><code>arrow-circle-1<\/code> (Arrow circle 1)<br><code>arrow-circle-2<\/code> (Arrow circle 2)<br><code>chevron<\/code><br><code>chevron-circle<\/code> (Chevron circle)<br><code>caret<\/code><br><code>caret-square<\/code> (Caret square)<br><code>folder-1<\/code> (Folder 1)<br><code>folder-2<\/code> (Folder 2)<br><br><strong>Default value:<\/strong> <code>plus<\/code><\/td><\/tr><tr><td><a name=\"option-anchor\" href=\"#option-anchor\">anchor<\/a><\/td><td>You can use a unique anchor for a spoiler to access it with hash in page URL. For example: use the word Hello and then use a URL like http:\/\/example.com\/page-url#Hello. This spoiler will be opened and scrolled in<\/td><\/tr><tr><td><a name=\"option-anchor_in_url\" href=\"#option-anchor_in_url\">anchor_in_url<\/a><\/td><td>This option specifies whether an anchor will be added to page URL after clicking the spoiler<br><br><strong>Possible values:<\/strong> <code>yes<\/code> or <code>no<\/code><br><br><strong>Default value:<\/strong> <code>no<\/code><\/td><\/tr><tr><td>scroll_offset<\/td><td>This option defines the top offset when the element is scrolled in. Can be useful along with the fixed site header.<br><br><strong>Possible values:<\/strong>&nbsp;number from&nbsp;<code>0<\/code>&nbsp;to&nbsp;<code>2000<\/code><br><br><strong>Default value:<\/strong>&nbsp;<code>0<\/code><\/td><\/tr><tr><td><a name=\"option-class\" href=\"#option-class\">class<\/a><\/td><td>Additional CSS class name(s) separated by space(s)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"if-accordion-doesnt-work\">If accordion doesn't work<\/h2>\n\n\n\n<p>If an accordion doesn't work, isn't collapsing or expanding, chances are you have a JavaScript error on your page. Read&nbsp;<a href=\"\/docs\/shortcodes-do-not-work\/\" data-type=\"URL\" data-id=\"\/docs\/shortcodes-do-not-work\/\">this<\/a>&nbsp;to learn how to fix it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"related-articles\">Related articles<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"\/docs\/how-to-disable-or-change-the-outline-around-tab-and-spoiler-titles\/\">Disabling the outline around spoiler title<\/a><\/li>\n\n\n\n<li><a href=\"\/docs\/customizing-the-spoiler-shortcode-appearance\/\">Customizing the spoiler shortcode appearance<\/a><\/li>\n<\/ul>\n","protected":false},"featured_media":36647,"template":"","docs_category":[21],"class_list":["post-33929","docs","type-docs","status-publish","has-post-thumbnail","hentry","docs_category-shortcodes"],"_links":{"self":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs\/33929","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/types\/docs"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/media\/36647"}],"wp:attachment":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/media?parent=33929"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs_category?post=33929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}