WidgetCoreWidgetCore Documentation

FAQ widget

The complete guide to the WidgetCore FAQ widget — question and answer items, accordion or toggle mode, icons, animation speed, question heading tag, FAQPage schema and styling.

The FAQ widget is an accessible accordion: every question is a button inside a heading tag, and every answer is a region connected to that button with aria-labelledby. Alongside the widget, FAQPage structured data is printed.

ItemValue
Widget namewgcr-faq
Panel titleFAQ
CategoryWidgetCore Widgets (wgcr)
Style / scriptwgcr-faq
Root class.wgcr-faq

The “Questions” section

The only control here is a repeater called Items with three fields:

FieldTypeDefaultNotes
Question titleText“Question title”The text on the button, and the value used for Question.name in the schema
AnswerWYSIWYG“Answer text…”The answer content; links and simple formatting are allowed
Open by defaultSwitcherNoWhen on, this item starts open

On first use the widget is filled with a few sample items so you can see the structure; replace all of their text with your own content.

The “Behaviour” section

ControlTypeValuesDefault
Opening modeSelectAccordion (only one item open) / Toggle (several items at once)Accordion
IconSelectPlus / Chevron / Custom (Elementor icon library)Plus
Custom iconIconFrom the Elementor icon library—
Animation speed (ms)Slider100 to 1000300

Accordion mode: opening an item closes the previously open one. Better for long lists and mobile screens.

Toggle mode: every item opens and closes independently, so visitors can keep several answers open at once; better for comparing questions.

Icons are inline SVG elements coloured with currentColor, so they follow the colour controls in the “Icon” section. In the open state the plus icon rotates 45 degrees and the chevron and custom icons rotate 180 degrees; the rotation of a custom icon is adjustable with “Custom icon rotation when open (degrees)”.

The “SEO and structure” section

ControlValuesDefaultNotes
Question heading tagH2 / H3 (recommended) / H4 / DIVH3Defines the heading structure of your page
FAQ schema (JSON-LD)Yes / NoYesPrints FAQPage structured data for search engines

Shape of the structured data output

json
{
	"@context": "https://schema.org",
	"@type": "FAQPage",
	"mainEntity": [
		{
			"@type": "Question",
			"name": "How are the courses delivered?",
			"acceptedAnswer": {
				"@type": "Answer",
				"text": "All courses are video-based and online…"
			}
		}
	]
}

The output is printed with JSON_UNESCAPED_UNICODE, so non-Latin text stays readable in the page source instead of becoming \uXXXX sequences.

HTML output structure

html
<div class="wgcr-faq" data-mode="accordion" data-speed="300">
	<div class="wgcr-faq-list">
		<div class="wgcr-faq-item open" data-icon="plus">
			<h3 class="wgcr-faq-qwrap">
				<button type="button" class="wgcr-faq-q" id="wgcr-faq-q-abc123-0"
					aria-expanded="true" aria-controls="wgcr-faq-a-abc123-0">
					<span class="wgcr-faq-qtext">Question title</span>
					<span class="wgcr-faq-ic"><svg viewBox="0 0 24 24" aria-hidden="true">…</svg></span>
				</button>
			</h3>
			<div class="wgcr-faq-a" role="region" id="wgcr-faq-a-abc123-0"
				aria-labelledby="wgcr-faq-q-abc123-0">
				<div class="wgcr-faq-atext">Answer text…</div>
			</div>
		</div>
	</div>
</div>
ClassRole
.wgcr-faqRoot; carries data-mode and data-speed
.wgcr-faq-listThe grid of items with an adjustable gap
.wgcr-faq-itemEach card; gets the open class when expanded
.wgcr-faq-qwrapThe heading tag (per the “Question heading tag” control)
.wgcr-faq-qThe question button; the keyboard focus target
.wgcr-faq-qtextThe question text (supports inline editing)
.wgcr-faq-icThe icon box
.wgcr-faq-aThe answer region with role="region"
.wgcr-faq-atextThe answer text

Accessibility and keyboard

KeyBehaviour
Enter or SpaceOpens or closes the focused question
ArrowDownMoves to the next question
ArrowUpMoves to the previous question
HomeFirst question
EndLast question
  • Closed answers leave the tab order (through visibility: hidden), so keyboard users never get trapped inside hidden content.
  • The focus ring is only painted for :focus-visible, so mouse clicks do not draw a blue outline.
  • When the visitor enabled prefers-reduced-motion, animation is removed and items open instantly.
  • The height of each open answer is measured dynamically and re-measured when the window is resized, so long answers are never clipped.
  • Movement between questions wraps around: after the last question, ArrowDown returns to the first.

More detail on the accessibility and keyboard shortcuts pages.

Style sections

Overall layout

ControlDefaultNotes
Max width—Width of the whole widget (760px in the inline CSS)
Widget horizontal alignmentCenterRight / Center / Left
Gap between cards14pxVertical spacing of items

Card body

ControlDefaultNotes
Backgroundrgba(255,255,255,0.72)Card background
Background (open)—Only for the open item
Border colour (open)—Border of the open item
Glass blur amount12pxThe backdrop-filter effect
Border radius12pxCard corner radius

Title

ControlDefault
Title row background—
Text colour#1F2937
Title row background (open)—
Text colour (open)—
Text colour (hover)—
Title row border radius—
Padding20px 24px

Answer card

ControlDefault
Background—
Text colour#6B7280
Background (open)—
Text colour (open)—
Border radius—
Padding0 24px 22px

Icon

ControlDefault
Gap from text16px
Box size30px
Icon size16px
Box radius8px
Custom icon rotation when open180deg
Background#EBF3FC
Icon colour#2E86DE
Background (open)#2E86DE
Icon colour (open)#ffffff

Custom styling example

To change the appearance outside the controls, this snippet in your theme's custom CSS is enough:

css
.wgcr-faq-item {
	border-radius: 16px;
	box-shadow: 0 2px 10px rgb(15 23 42 / 6%);
}
.wgcr-faq-item.open .wgcr-faq-qtext {
	color: #1d4ed8;
}
@media (prefers-reduced-motion: reduce) {
	.wgcr-faq-a { transition: none; }
}

Complete control reference

Every content control of the widget, in panel order. Style controls are listed in “Style sections” above.

IdPanel labelTypeDefaultShown when
itemsQuestionsRepeaterThree sample questions—
questionQuestion titleText“Question title”Inside each item
answerAnswerText editor“Answer text…”Inside each item
open_defaultOpen by defaultSwitcherNoInside each item
modeOpening modeSelectaccordion—
icon_typeIconSelectplus—
custom_iconCustom iconIcon pickerfas fa-plusicon_type = custom
speedAnimation speed (milliseconds)Slider, 100 to 1000300—
q_tagQuestion title tagSelecth3—
schemaFAQ schema (JSON-LD)SwitcherYes—

Troubleshooting

SymptomCauseFix
Items do not openThe widget script did not loadCheck in developer tools whether wgcr-faq loaded; clear caches
A very long answer is clippedThe script did not run, so the CSS cap (max-height: 640px) appliesWith the script running, each answer's height is set to its real content height; clear caches
No schema on the pageThe “FAQ schema” control is off, or this is the second widgetTurn the control on or move the widget first
The custom icon does not rotateThe icon type is not “Custom”Set “Icon” to “Custom (Elementor icon library)”