[Resolved] GenerateBlocks Full Width Container – Rankmath FAQ not added to the schema

Home Forums Support [Resolved] GenerateBlocks Full Width Container – Rankmath FAQ not added to the schema

Home Forums Support GenerateBlocks Full Width Container – Rankmath FAQ not added to the schema

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #1570623
    Kumar

    Hi Tom,

    I am using GB container block, I set up Rankmath FAQ within it. But when I check on google structured data tool, they don’t seem to appear. Example in the below box.

    Is this something you can help me with?

    Thanks
    Kumar

    #1570763
    David
    Staff
    Customer Support

    Hi there,

    do they appear if you add the FAQ block to a normal page – ie. not in a container block?

    #1570925
    Kumar

    Hi David

    I have checked:
    Rankmath FAQ doesn’t work when inside GB container but works when outside.

    Thanks
    Kumar

    #1571044
    Elvin
    Staff
    Customer Support

    Hi,

    You can try this PHP snippet a user provided from one of the RankMath tickets.

    https://support.rankmath.com/ticket/faq-schema-not-showing/#post-83248

    #1571276
    Kumar

    Hi there

    I added the below code in the Snippet plugin and it doesnt work. Is the code valid? Does it need tweaking?

    “Adding this code snippet to functions.php solved the issue:

    add_filter( ‘rank_math/schema/nested_blocks’, function( $nested ) {
    $nested[] = ‘generateblocks/container’;
    $nested[] = ‘generateblocks/grid’;
    return $nested;
    });”

    #1571329
    David
    Staff
    Customer Support

    Quick question – which version of GenerateBlocks are you using ? Is it the latest 1.2 release?

    #1571346
    Kumar

    yes, thats right – Version 1.2.0

    #1571495
    David
    Staff
    Customer Support

    What happens if you use a Group Block ?

    #1571525
    Kumar

    Hi David,

    Yes seems to be working with the group block. but the width of the group block is 1080 and the rest of the article width is 700px as you can see in the link below.

    #1571722
    David
    Staff
    Customer Support

    Ok, so add this CSS:

    .wp-block-group.narrow-container .wp-block-group__inner-container {
        max-width: 620px;
    }

    I have set it to 620px to take into account the Container Blocks 40px padding.

    Then select the Group Block and in Advanced > Additional CSS Class(es) add narrow-container

    Please let us know if Rank Math get back to you on this.

    #1571771
    Kumar

    Hi David,

    Thanks a lot. That works great.

    The only problem is, we already have it enabled on 80+ articles with the generateblocks container. Would be so manual to change them each one by one and add the class to each as well. Is there any easier way to make it work while inside the GB container block itself?

    #1571895
    Leo
    Staff
    Customer Support

    You would need to add the custom class to each block unfortunately.

    #1656441
    Manuel

    Hi
    I am currently facing the same issue. The mentioned workaround

    add_filter( ‘rank_math/schema/nested_blocks’, function( $nested ) {
    $nested[] = ‘generateblocks/container’;
    $nested[] = ‘generateblocks/grid’;
    return $nested;
    });”

    does not work.
    Is the problem related to rank math or generatepress/generateblocks?
    Would be great if this could work without switching to group block.

    #1656459
    Leo
    Staff
    Customer Support

    I wonder if it’s because the quotation mark is wrong in your code.

    Can you try this?

    add_filter( 'rank_math/schema/nested_blocks', function( $nested ) {
    $nested[] = 'generateblocks/container';
    $nested[] = 'generateblocks/grid';
    return $nested;
    });
    #1656460
    Manuel

    Hello Leo
    thanks for your reply.
    Seems to have been a copy and paste error from my side here. Should be without the quotation mark of course. Nevertheless the mentioned code does not work.

Viewing 15 posts - 1 through 15 (of 22 total)
  • You must be logged in to reply to this topic.