.wp-seo-faq-wrapper {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
max-width: 800px;
margin: 20px auto;
border: 1px solid #e2e8f0;
border-radius: 8px;
overflow: hidden;
background: #ffffff;
}
.wp-seo-faq-item {
border-bottom: 1px solid #e2e8f0;
}
.wp-seo-faq-item:last-child {
border-bottom: none;
}
.wp-seo-faq-question {
padding: 18px 25px;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
background: #f8fafc;
font-weight: 600;
color: #1e293b;
transition: background 0.2s;
user-select: none;
}
.wp-seo-faq-question:hover {
background: #f1f5f9;
}
.wp-seo-faq-answer {
display: none;
padding: 20px 25px;
line-height: 1.6;
color: #475569;
background: #ffffff;
}
.wp-seo-faq-icon {
font-weight: bold;
font-size: 1.2em;
transition: transform 0.2s;
}
How does this SEO implementation improve rankings?
+
By utilizing structured JSON-LD data and semantic HTML5 tags, this component helps search engine crawlers understand the context of your content, leading to higher click-through rates via rich snippets.
Is this layout mobile responsive?
+
Yes, the block-level layout uses fluid widths and system fonts to ensure fast loading times and perfect readability across all devices and screen sizes.
Can I customize the styles easily?
+
Absolutely. The CSS is contained within a single style block using unique class names to prevent conflicts with your existing WordPress theme styles.
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [{
"@type": "Question",
"name": "How does this SEO implementation improve rankings?",
"acceptedAnswer": {
"@type": "Answer",
"text": "By utilizing structured JSON-LD data and semantic HTML5 tags, this component helps search engine crawlers understand the context of your content."
}
}, {
"@type": "Question",
"name": "Is this layout mobile responsive?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes, the block-level layout uses fluid widths and system fonts to ensure fast loading times and perfect readability across all devices."
}
}, {
"@type": "Question",
"name": "Can I customize the styles easily?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Absolutely. The CSS is contained within a single style block using unique class names to prevent conflicts with your existing WordPress theme styles."
}
}]
}
function toggleWpSeoFaq(element) {
var answer = element.nextElementSibling;
var icon = element.querySelector('.wp-seo-faq-icon');
var isOpen = answer.style.display === 'block';
var allAnswers = element.parentElement.parentElement.querySelectorAll('.wp-seo-faq-answer');
var allIcons = element.parentElement.parentElement.querySelectorAll('.wp-seo-faq-icon');
for (var i = 0; i < allAnswers.length; i++) {
allAnswers[i].style.display = 'none';
allIcons[i].innerHTML = '+';
allIcons[i].style.transform = 'rotate(0deg)';
}
if (!isOpen) {
answer.style.display = 'block';
icon.innerHTML = '−';
icon.style.transform = 'rotate(180deg)';
} else {
answer.style.display = 'none';
icon.innerHTML = '+';
icon.style.transform = 'rotate(0deg)';
}
}