Home Forums WoodMart support forum There is no FAQ schema markup in the them Accordions

There is no FAQ schema markup in the them Accordions

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #695036

    OnPa Marketing
    Participant

    thanks.
    i have just recognise that there is no FAQ schema markup in the them Accordions.

    Attachments:
    You must be logged in to view attached files.
    #695097

    Artem Temos
    Keymaster

    Hello,

    There is no FAQ schema option in the accordion element at the moment. We will consider adding it in our future updates.

    Kind Regards

    #695125

    OnPa Marketing
    Participant

    i have bought the theme and going to build at least 5 websites. These site must have FAQ with schema. Could you please help me to implement FAQ schema. Or Change the theme with a one, which update to date and contain FAQ schema. Thanks.

    #695155

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to add this

    // Custom function to add FAQ schema markup
    // for Elementor accordion element.
    
    if ( ! function_exists( 'xts_output_faq_schema' ) ) {
       function xts_output_faq_schema() {
          if ( empty( $GLOBALS['xts_faq_entities'] ) || ! is_array( $GLOBALS['xts_faq_entities'] ) ) {
             return;
          }
    
          ?>
          <script type="application/ld+json">
          {
             "@context": "https://schema.org",
             "@type": "FAQPage",
             "mainEntity": [<?php echo implode( ',', $GLOBALS['xts_faq_entities'] ); // phpcs:ignore ?>]
          }
          </script>
          <?php
       }
    
       add_action( 'wp_footer', 'xts_output_faq_schema' );
    
    }
    
    if ( ! function_exists( 'xts_render_elementor_accordion_faq_schema' ) ) {
       function xts_render_elementor_accordion_faq_schema( $widget ) {
          if ( ! $widget || 'xts_accordion' !== $widget->get_name() ) {
             return;
          }
    
          $settings = $widget->get_settings_for_display();
    
          if ( empty( $settings['faq_schema'] ) || 'yes' !== $settings['faq_schema'] || empty( $settings['accordion_items'] ) ) {
             return;
          }
    
          if ( ! isset( $GLOBALS['xts_faq_entities'] ) ) {
             $GLOBALS['xts_faq_entities'] = array();
          }
    
          foreach ( $settings['accordion_items'] as $item ) {
             $question = trim( wp_strip_all_tags( $item['item_title'] ) );
    
             if ( 'html_block' === $item['content_type'] && $item['html_block_id'] ) {
                $answer = trim(
                   strip_tags(
                      preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', xts_get_html_block_content( $item['html_block_id'] ) ),
                      '<br>'
                   )
                );
             } else {
                $answer = trim(
                   strip_tags(
                      preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $item['item_desc'] ),
                      '<br>'
                   )
                );
             }
    
             if ( ! $question || ! $answer ) {
                continue;
             }
    
             $GLOBALS['xts_faq_entities'][] = '{
                "@type": "Question",
                "name": ' . wp_json_encode( $question, JSON_UNESCAPED_UNICODE ) . ',
                "acceptedAnswer": {
                   "@type": "Answer",
                   "text": ' . wp_json_encode( $answer, JSON_UNESCAPED_UNICODE ) . '
                   }
                }';
          }
       }
       add_action( 'elementor/frontend/widget/after_render', 'xts_render_elementor_accordion_faq_schema' );
    }
    
    if ( ! function_exists( 'xts_add_faq_schema_switcher_to_accordion' ) ) {
       function xts_add_faq_schema_switcher_to_accordion( $element, $args ) {
          if ( ! xts_is_elementor_installed() ) {
             return;
          }
    
          $element->add_control(
             'faq_schema',
             array(
                'label'        => esc_html__( 'Add FAQ schema', 'xts-theme' ),
                'type'         => \Elementor\Controls_Manager::SWITCHER,
                'label_on'     => esc_html__( 'Yes', 'xts-theme' ),
                'label_off'    => esc_html__( 'No', 'xts-theme' ),
                'return_value' => 'yes',
                'default'      => '',
                'description'  => esc_html__( 'If enabled, the accordion widget will add FAQPage schema for better SEO.', 'xts-theme' ),
             )
          );
       }
    
       add_action(
          'elementor/element/xts_accordion/general_content_section/before_section_end',
          'xts_add_faq_schema_switcher_to_accordion',
          10,
          2
       );
    }

    https://monosnap.ai/file/mk8Iy5oGlnrtS3E2sPZyED6tW3Gr3e

    #695232

    OnPa Marketing
    Participant

    is there any other workaround? i can not add to each of the website like you recommend? Could you please update the theme from your side so that i update the new version.

    Issue:
    Mobile nav bar does not show? i have added the website in private content section.
    i have checked on iphone. check the screenshot please for reference.

    Attachments:
    You must be logged in to view attached files.
    #695306

    Artem Temos
    Keymaster

    You need to disable the maintenance mode to fix the mobile navbar issue.

    Currently, we don’t have plans to release a theme update with this feature.

    #695384

    OnPa Marketing
    Participant

    Hi,
    the mobile navigation issue is now resolved.

    Regarding the FAQ schema issue:
    This feature is quite basic and should be included in any modern theme by default.
    Could you please let me know when you plan to add this feature?
    If it’s not going to be implemented in the near future, I’m afraid I’ll have to request a refund.

    Best regards,

    #695571

    Artem Temos
    Keymaster

    Hello,

    This feature will be considered to be added in our next theme update but since we just released the update, we can’t guarantee that it will be updated soon. If you want, we can release a patch for this.

    Kind Regards

    #695761

    OnPa Marketing
    Participant

    hi,
    if patch would resolve the issue, do it please.
    I have added product schema markup but it shows in front end in header section. Here is the service page (https://www.foto-scene.de/passfotos-berlin/).

    Attachments:
    You must be logged in to view attached files.
    #695830

    Artem Temos
    Keymaster

    Hello,

    Please apply the patch #695810

    The FAQ Schema appears in the footer because it’s generated based on the content of the accordions, which load along with the page content.
    Rank Math adds schema to the head section since it works with product metadata that’s available earlier.

    For Google, it doesn’t matter where the schema is placed — the key point is that it’s valid and matches the page content.

    Kind Regards

    #695923

    OnPa Marketing
    Participant

    i applied the patcher and i can see that there FAQ schema markup. As i said there the product schema markup info appeared in frontend ( https://www.foto-scene.de/passfotos-berlin/). After applying the patcher even shows in the header of the landing page as well footer of the landing page. Check the video below please.

    Thanks

    #696034

    Artem Temos
    Keymaster

    The review or rating must be displayed on the page according to Google Schema rules.
    Therefore, when you add the schema through the Schema Generator, pay attention to the Review location option, which allows Rank Math to output the review data –
    https://monosnap.ai/file/zABzVfu13WrJljcd47jhOyQwaRLyN2

    https://rankmath.com/kb/product-schema/#num-3-review-location

    I also checked this on the default theme — it also adds the review at the top/bottom, and the patch has no impact on this.

Viewing 12 posts - 1 through 12 (of 12 total)