Good day, lovely Theme.co-Support team.
I have a question about the new FAQ schema feature, specifically the ‘Entity’ and ‘Is part of’ fields. Thanks for implementing them. It’s great!
I’m using an accordion element with a looper component on my website. This component is the base for a custom Gutenberg FAQ block with ACF to add FAQs to individual blog posts. It works well so far, but the FAQ schema behaves strangely.
While the questions and answers show up in the schema, there are also those from a different blog post.
For example, here you can see the FAQ from here.
I understand you don’t support custom solutions, but I’m trying to figure out if this is a limitation of using loopers in components or a bug.
Can you point me in the right direction?
Here’s my FAQ Component:
{"_type":“accordion”,"_bp_base":“3_4”,"_c_unwrap":false,"_customize_component":false,"_hidden":false,"_icon":"","_label":“Blog: Akkordion FAQ”,"_locked":false,"_p_data":{},"_p_json":"","_p_local":{},“accordion_base_font_size”:“1em”,“accordion_bg_color”:“transparent”,“accordion_border_color”:“global-color:S1SMfkoS2c3e2vB8IN global-color:T71fuI098uWpqlpugu global-color:S1SMfkoS2c3e2vB8IN global-color:T71fuI098uWpqlpugu”,“accordion_border_radius”:"!0px",“accordion_border_style”:“solid solid solid solid”,“accordion_border_width”:“1px 0px 0px 0px”,“accordion_box_shadow_color”:“rgba(0, 0, 0, 0.25)”,“accordion_box_shadow_dimensions”:"!0em 0em 1em 0em",“accordion_content_bg_color”:“global-color:Mc6fY3mHiAza3GYD1C”,“accordion_content_border_color”:“global-color:D4LmCOxr5dVie3FVgQ transparent transparent transparent”,“accordion_content_border_radius”:"!0px",“accordion_content_border_style”:“solid”,“accordion_content_border_width”:“1px 0 0 0”,“accordion_content_box_shadow_color”:“rgba(0, 0, 0, 0.25)”,“accordion_content_box_shadow_dimensions”:"!0em 0em 1em 0em",“accordion_content_font_family”:“inherit”,“accordion_content_font_size”:“var(–cs-base)”,“accordion_content_font_style”:“normal”,“accordion_content_font_weight”:“inherit”,“accordion_content_letter_spacing”:“0em”,“accordion_content_line_height”:“1.6”,“accordion_content_margin”:"!0em",“accordion_content_padding”:“20px 20px 20px 20px”,“accordion_content_text_align”:“none”,“accordion_content_text_color”:“rgba(0, 0, 0, 1)”,“accordion_content_text_decoration”:“none”,“accordion_content_text_shadow_color”:“rgba(0, 0, 0, 0.25)”,“accordion_content_text_shadow_dimensions”:"!0px 0px 10px",“accordion_content_text_transform”:“none”,“accordion_faq_schema”:true,“accordion_group”:"",“accordion_grouped”:false,“accordion_header_bg_color”:“rgba(255, 255, 255, 1)”,“accordion_header_bg_color_alt”:“global-color:Mc6fY3mHiAza3GYD1C”,“accordion_header_border_color”:“transparent”,“accordion_header_border_color_alt”:“transparent”,“accordion_header_border_radius”:"!0px",“accordion_header_border_style”:“solid”,“accordion_header_border_width”:"!0px",“accordion_header_box_shadow_color”:“rgba(0, 0, 0, 0.25)”,“accordion_header_box_shadow_color_alt”:"",“accordion_header_box_shadow_dimensions”:"!0em 0em 1em 0em",“accordion_header_content_reverse”:true,“accordion_header_content_spacing”:“0.5em”,“accordion_header_font_family”:“inherit”,“accordion_header_font_size”:“var(–cs-ms)”,“accordion_header_font_style”:“normal”,“accordion_header_font_weight”:“fw-bold”,“accordion_header_indicator”:true,“accordion_header_indicator_color”:“global-color:D4LmCOxr5dVie3FVgQ”,“accordion_header_indicator_color_alt”:“global-color:KGmfkWVJG1rjGEokpw”,“accordion_header_indicator_font_size”:“var(–cs-xl)”,“accordion_header_indicator_height”:“1em”,“accordion_header_indicator_icon”:“sr-chevron-left”,“accordion_header_indicator_rotation_end”:“90deg”,“accordion_header_indicator_rotation_start”:"-90deg",“accordion_header_indicator_text”:“▸”,“accordion_header_indicator_type”:“icon”,“accordion_header_indicator_width”:“auto”,“accordion_header_letter_spacing”:“0em”,“accordion_header_line_height”:“1.3”,“accordion_header_margin”:"!0em",“accordion_header_padding”:“20px 20px 20px 20px”,“accordion_header_text_align”:“left”,“accordion_header_text_color”:“global-color:eYZoiZMslQcp1U1oJz”,“accordion_header_text_color_alt”:“global-color:KGmfkWVJG1rjGEokpw”,“accordion_header_text_decoration”:“none”,“accordion_header_text_layout_tag”:“span”,“accordion_header_text_overflow”:false,“accordion_header_text_shadow_color”:“rgba(0, 0, 0, 0.25)”,“accordion_header_text_shadow_color_alt”:"",“accordion_header_text_shadow_dimensions”:"!0px 0px 10px",“accordion_header_text_transform”:“none”,“accordion_item_bg_color”:“rgba(255, 255, 255, 1)”,“accordion_item_border_color”:“global-color:T71fuI098uWpqlpugu transparent global-color:S1SMfkoS2c3e2vB8IN transparent”,“accordion_item_border_radius”:"!0.35em 0.35em 0.35em 0.35em",“accordion_item_border_style”:“solid solid solid solid”,“accordion_item_border_width”:“0px 0px 1px 0px”,“accordion_item_box_shadow_color”:“rgba(0, 0, 0, 0.25)”,“accordion_item_box_shadow_dimensions”:"!0em 0.15em 0.65em 0em",“accordion_item_overflow”:true,“accordion_item_padding”:"!0em",“accordion_item_spacing”:“0px”,“accordion_margin”:"!0em",“accordion_max_width”:“none”,“accordion_padding”:"!0em",“accordion_schema_id”:"{{dc:post:permalink}}#faq",“accordion_schema_is_part_of”:"{{dc:post:permalink}}",“accordion_scroll_follow”:“mobile”,“accordion_width”:“100%”,“class”:"{{ post.slug }}-faq",“css”:"",“custom_atts”:"",“effects_alt”:false,“effects_animation_alt”:“tada”,“effects_animation_enter”:“rollIn”,“effects_animation_exit”:“rollOut”,“effects_backdrop_filter”:"",“effects_backface_visibility”:“visible”,“effects_behavior_scroll”:“fire-once”,“effects_delay_scroll”:“0ms”,“effects_duration”:“300ms”,“effects_duration_animation_alt”:“1000ms”,“effects_duration_scroll”:“1000ms”,“effects_filter”:"",“effects_filter_alt”:"",“effects_filter_enter”:"",“effects_filter_exit”:"",“effects_mask”:false,“effects_mask_composite”:“exclude”,“effects_mask_custom_mask_image”:"",“effects_mask_image_src”:"",“effects_mask_linear_application”:“outer”,“effects_mask_linear_direction”:“to right”,“effects_mask_linear_inner_stop_begin”:“10%”,“effects_mask_linear_inner_stop_end”:“90%”,“effects_mask_linear_outer_stop_begin”:“1%”,“effects_mask_linear_outer_stop_end”:“99%”,“effects_mask_median_axis”:“x”,“effects_mask_median_transition_stop”:“600px”,“effects_mask_median_visible_stop”:“1200px”,“effects_mask_position”:“center”,“effects_mask_radial_application”:“outer”,“effects_mask_radial_center”:“center”,“effects_mask_radial_inner_stop”:“66%”,“effects_mask_radial_outer_stop”:“99%”,“effects_mask_radial_shape”:“circle”,“effects_mask_radial_size”:“farthest-side”,“effects_mask_repeat”:“no-repeat”,“effects_mask_size”:“contain”,“effects_mix_blend_mode”:“normal”,“effects_offset_bottom”:“10%”,“effects_offset_top”:“10%”,“effects_opacity”:“1”,“effects_opacity_alt”:“1”,“effects_opacity_enter”:“1”,“effects_opacity_exit”:“0”,“effects_pointer_events_scroll”:“none”,“effects_provider”:false,“effects_provider_targets”:“colors particles effects”,“effects_scroll”:false,“effects_timing_function”:“cubic-bezier(0.400, 0.000, 0.200, 1.000)”,“effects_timing_function_animation_alt”:“cubic-bezier(0.400, 0.000, 0.200, 1.000)”,“effects_timing_function_scroll”:“cubic-bezier(0.400, 0.000, 0.200, 1.000)”,“effects_transform”:"",“effects_transform_alt”:"",“effects_transform_enter”:“translate(0px, 0px)”,“effects_transform_exit”:“translate(0px, 1rem)”,“effects_transform_origin”:“50% 50%”,“effects_type_alt”:“transform”,“effects_type_mask”:“linear”,“effects_type_scroll”:“transform”,“hide_bp”:"",“id”:"",“looper_consumer”:false,“looper_consumer_repeat”:"-1",“looper_consumer_rewind”:false,“looper_provider”:true,“looper_provider_array_loop_keys”:false,“looper_provider_array_offset”:"",“looper_provider_breadcrumbs_home_label”:“Home”,“looper_provider_csv_content”:"",“looper_provider_csv_delimiter”:",",“looper_provider_csv_file”:"",“looper_provider_csv_has_header”:true,“looper_provider_csv_type”:“file”,“looper_provider_custom”:"",“looper_provider_dc”:"{{dc:acf:post_field field=“faqs”}}",“looper_provider_json”:"{{dc:param:items}}",“looper_provider_key_array”:"{{dc:param:items}}",“looper_provider_menu_menu_id”:"",“looper_provider_query-builder_custom_atts”:"",“looper_provider_query-builder_meta_relation”:“AND”,“looper_provider_query-builder_meta_values”:[],“looper_provider_query-builder_orderby_meta_key”:"",“looper_provider_query_after”:"",“looper_provider_query_author_ids”:"",“looper_provider_query_author_in”:true,“looper_provider_query_before”:"",“looper_provider_query_count”:"",“looper_provider_query_include_sticky”:false,“looper_provider_query_offset”:"",“looper_provider_query_order”:“DESC”,“looper_provider_query_orderby”:“date”,“looper_provider_query_post_ids”:"",“looper_provider_query_post_in”:true,“looper_provider_query_post_status”:[],“looper_provider_query_post_types”:[“post”],“looper_provider_query_recent_exclude_current”:false,“looper_provider_query_string”:"",“looper_provider_query_term_and”:false,“looper_provider_query_term_ids”:"",“looper_provider_query_term_in”:true,“looper_provider_range_max”:10,“looper_provider_range_min”:1,“looper_provider_range_steps”:1,“looper_provider_string_content”:"",“looper_provider_string_delim”:"",“looper_provider_tax”:“category”,“looper_provider_tax_hide_empty”:false,“looper_provider_terms_tax”:“category”,“looper_provider_type”:“dc”,“looper_provider_user_blog_id”:0,“looper_provider_user_capability”:"",“looper_provider_user_capability__in”:"",“looper_provider_user_capability__not_in”:"",“looper_provider_user_exclude”:[],“looper_provider_user_include”:[],“looper_provider_user_meta_relation”:“OR”,“looper_provider_user_meta_values”:[],“looper_provider_user_number”:"",“looper_provider_user_offset”:0,“looper_provider_user_order”:“ASC”,“looper_provider_user_orderby”:“display_name”,“looper_provider_user_role”:"",“looper_provider_user_role__in”:"",“looper_provider_user_role__not_in”:"",“looper_provider_user_search”:"",“looper_provider_user_search_columns”:[],“show_condition”:"","_modules":[{"_type":“accordion-item-elements”,"_bp_base":“3_4”,"_c_unwrap":false,"_customize_component":false,"_hidden":false,"_icon":"","_label":"<span style=“text-align: left;”>{{dc:looper:field key=“question”}}","_locked":false,"_p_data":{},"_p_json":"","_p_local":{},“accordion_item_header_content”:"<span style=“text-align: left;”>{{dc:looper:field key=“question”}}",“accordion_item_starts_open”:false,“class”:"",“css”:"",“custom_atts”:"",“hide_bp”:"",“id”:“question-{{ looper.index_number }}”,“looper_consumer”:true,“looper_consumer_repeat”:"-1",“looper_consumer_rewind”:false,“looper_provider”:false,“looper_provider_array_loop_keys”:false,“looper_provider_array_offset”:"",“looper_provider_breadcrumbs_home_label”:“Home”,“looper_provider_csv_content”:"",“looper_provider_csv_delimiter”:",",“looper_provider_csv_file”:"",“looper_provider_csv_has_header”:true,“looper_provider_csv_type”:“file”,“looper_provider_custom”:"",“looper_provider_dc”:"",“looper_provider_json”:"",“looper_provider_key_array”:"",“looper_provider_menu_menu_id”:"",“looper_provider_query-builder_custom_atts”:"",“looper_provider_query-builder_meta_relation”:“AND”,“looper_provider_query-builder_meta_values”:[],“looper_provider_query-builder_orderby_meta_key”:"",“looper_provider_query_after”:"",“looper_provider_query_author_ids”:"",“looper_provider_query_author_in”:true,“looper_provider_query_before”:"",“looper_provider_query_count”:"",“looper_provider_query_include_sticky”:false,“looper_provider_query_offset”:"",“looper_provider_query_order”:“DESC”,“looper_provider_query_orderby”:“date”,“looper_provider_query_post_ids”:"",“looper_provider_query_post_in”:true,“looper_provider_query_post_status”:[],“looper_provider_query_post_types”:[“post”],“looper_provider_query_recent_exclude_current”:false,“looper_provider_query_string”:"",“looper_provider_query_term_and”:false,“looper_provider_query_term_ids”:"",“looper_provider_query_term_in”:true,“looper_provider_range_max”:10,“looper_provider_range_min”:1,“looper_provider_range_steps”:1,“looper_provider_string_content”:"",“looper_provider_string_delim”:"",“looper_provider_tax”:“category”,“looper_provider_tax_hide_empty”:false,“looper_provider_terms_tax”:“category”,“looper_provider_type”:“query-recent”,“looper_provider_user_blog_id”:0,“looper_provider_user_capability”:"",“looper_provider_user_capability__in”:"",“looper_provider_user_capability__not_in”:"",“looper_provider_user_exclude”:[],“looper_provider_user_include”:[],“looper_provider_user_meta_relation”:“OR”,“looper_provider_user_meta_values”:[],“looper_provider_user_number”:"",“looper_provider_user_offset”:0,“looper_provider_user_order”:“ASC”,“looper_provider_user_orderby”:“display_name”,“looper_provider_user_role”:"",“looper_provider_user_role__in”:"",“looper_provider_user_role__not_in”:"",“looper_provider_user_search”:"",“looper_provider_user_search_columns”:[],“show_condition”:"",“toggle_hash”:"","_modules":[{"_type":“raw-content”,"_bp_base":“3_4”,"_c_unwrap":false,"_customize_component":false,"_hidden":false,"_icon":"","_label":"","_locked":false,"_p_data":{},"_p_json":"","_p_local":{},“disable_preview”:false,“looper_consumer”:true,“looper_consumer_repeat”:"-1",“looper_consumer_rewind”:false,“looper_provider”:false,“looper_provider_array_loop_keys”:false,“looper_provider_array_offset”:"",“looper_provider_breadcrumbs_home_label”:“Home”,“looper_provider_csv_content”:"",“looper_provider_csv_delimiter”:",",“looper_provider_csv_file”:"",“looper_provider_csv_has_header”:true,“looper_provider_csv_type”:“file”,“looper_provider_custom”:"",“looper_provider_dc”:"",“looper_provider_json”:"",“looper_provider_key_array”:"",“looper_provider_menu_menu_id”:"",“looper_provider_query-builder_custom_atts”:"",“looper_provider_query-builder_meta_relation”:“AND”,“looper_provider_query-builder_meta_values”:[],“looper_provider_query-builder_orderby_meta_key”:"",“looper_provider_query_after”:"",“looper_provider_query_author_ids”:"",“looper_provider_query_author_in”:true,“looper_provider_query_before”:"",“looper_provider_query_count”:"",“looper_provider_query_include_sticky”:false,“looper_provider_query_offset”:"",“looper_provider_query_order”:“DESC”,“looper_provider_query_orderby”:“date”,“looper_provider_query_post_ids”:"",“looper_provider_query_post_in”:true,“looper_provider_query_post_status”:[],“looper_provider_query_post_types”:[“post”],“looper_provider_query_recent_exclude_current”:false,“looper_provider_query_string”:"",“looper_provider_query_term_and”:false,“looper_provider_query_term_ids”:"",“looper_provider_query_term_in”:true,“looper_provider_range_max”:10,“looper_provider_range_min”:1,“looper_provider_range_steps”:1,“looper_provider_string_content”:"",“looper_provider_string_delim”:"",“looper_provider_tax”:“category”,“looper_provider_tax_hide_empty”:false,“looper_provider_terms_tax”:“category”,“looper_provider_type”:“query-recent”,“looper_provider_user_blog_id”:0,“looper_provider_user_capability”:"",“looper_provider_user_capability__in”:"",“looper_provider_user_capability__not_in”:"",“looper_provider_user_exclude”:[],“looper_provider_user_include”:[],“looper_provider_user_meta_relation”:“OR”,“looper_provider_user_meta_values”:[],“looper_provider_user_number”:"",“looper_provider_user_offset”:0,“looper_provider_user_order”:“ASC”,“looper_provider_user_orderby”:“display_name”,“looper_provider_user_role”:"",“looper_provider_user_role__in”:"",“looper_provider_user_role__not_in”:"",“looper_provider_user_search”:"",“looper_provider_user_search_columns”:[],“raw_content”:"<div class=“answer-{{ looper.index_number }}”>{{dc:looper:field key=“answer”}}",“render_blocks”:true,"_modules":[]}]}]}
and this is my MU-plugin (just in case someone else is struggling as well)
<?php
/**
- Plugin Name: FAQ Gutenberg Block (Cornerstone Accordion via Looper)
- Description: Editor zeigt eine kompakte Vorschau (Icon + Frage + kurze Antwort). Frontend rendert Cornerstone-Component.
- Version: 1.3.0
*/
if ( ! defined(‘ABSPATH’) ) exit;
add_action(‘init’, function () {
if ( ! function_exists(‘acf_register_block_type’) ) return;
acf_register_block_type([
‘name’ => ‘faq’,
‘title’ => __(‘FAQ’),
‘description’ => __(‘FAQ-Block mit ACF-Repeater (faqs).’),
‘category’ => ‘formatting’,
‘icon’ => ‘editor-help’,
‘render_callback’ => ‘cs_faq_render_block’,
‘supports’ => [‘align’ => false],
]);
});
/**
- Hilfsfunktion: Antwort auf ~180 Zeichen kürzen (HTML -> Text)
*/
function cs_faq_answer_excerpt($html, $max = 180){
// HTML zu Text
$text = wp_strip_all_tags( (string) $html, true );
$text = html_entity_decode( $text, ENT_QUOTES, ‘UTF-8’ );
$text = trim( preg_replace(’/\s+/’, ’ ', $text) );
if ( function_exists(‘wp_html_excerpt’) ) {
return wp_html_excerpt( $text, $max, ‘…’ );
}
// Fallback
if ( mb_strlen($text, ‘UTF-8’) <= $max ) return $text;
return rtrim( mb_substr($text, 0, $max, ‘UTF-8’) ) . ‘…’;
}
function cs_faq_render_block( $block, $content = ‘’, $is_preview = false, $post_id = 0 ) {
$component_id = ‘WVR1GkHHR8mKDuimml’;
// ACF: Repeater ‘faqs’ (question + answer)
$faqs = function_exists(‘get_field’) ? ( get_field(‘faqs’) ?: [] ) : [];
// — Editor-Vorschau ------------------------------------------------------
if ( $is_preview ) {
if ( empty($faqs) ) {
echo ‘
return;
}
$items = array_slice($faqs, 0, 6); // max. 6 Vorschauen
$moreCount = max(0, count($faqs) - count($items));
?>
<style>
.faq-block-preview{border:1px solid #e2e8f0;border-radius:10px;background:#fff;padding:12px 14px}
.faq-block-preview .faq-row{padding:10px 0;border-top:1px solid #f1f5f9}
.faq-block-preview .faq-row:first-child{border-top:0}
.faq-block-preview .head{display:flex;align-items:flex-start;gap:10px}
.faq-block-preview .chev{display:inline-flex;width:16px;height:16px;transform:rotate(-90deg);opacity:.65;margin-top:2px;flex:0 0 16px}
.faq-block-preview .chev svg{width:16px;height:16px}
.faq-block-preview .q{font-weight:600;line-height:1.35}
.faq-block-preview .a{
margin-left:26px; /* Icon (16) + gap (10) */
font-size:13px; line-height:1.45; color:#475569;
display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
margin-top:4px;
}
.faq-block-preview .more{margin-top:8px;color:#64748b;font-size:12px}
</style>
<div class="faq-block-preview">
<?php foreach ($items as $row): ?>
<?php
$q = isset($row['question']) ? wp_strip_all_tags($row['question']) : '';
$a = isset($row['answer']) ? cs_faq_answer_excerpt($row['answer']) : '';
?>
<div class="faq-row">
<div class="head">
<span class="chev" aria-hidden="true">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round">
<path d="M15.5 5l-7 7 7 7"></path>
</svg>
</span>
<span class="q"><?php echo esc_html($q); ?></span>
</div>
<?php if ($a !== ''): ?>
<div class="a"><?php echo esc_html($a); ?></div>
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php if ($moreCount > 0): ?>
<div class="more">… und <?php echo (int) $moreCount; ?> weitere</div>
<?php endif; ?>
</div>
<?php
return;
}
// --- Frontend: Cornerstone-Component rendert via {{dc:acf:post_field field="faqs"}} ----
echo do_shortcode('[cs_component id="' . esc_attr($component_id) . '"]');
}
Thank you as always, and also for keep improving the theme. I can’t wait to use the new Forms in my future builds. 