Home › Forums › Support › GenerateBlocks Full Width Container – Rankmath FAQ not added to the schema
- This topic has 21 replies, 6 voices, and was last updated 3 years, 2 months ago by Tom.
-
AuthorPosts
-
December 7, 2020 at 9:29 am #1570623Kumar
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
KumarDecember 7, 2020 at 12:07 pm #1570763DavidStaffCustomer SupportHi there,
do they appear if you add the FAQ block to a normal page – ie. not in a container block?
December 7, 2020 at 3:05 pm #1570925KumarHi David
I have checked:
Rankmath FAQ doesn’t work when inside GB container but works when outside.Thanks
KumarDecember 7, 2020 at 6:53 pm #1571044ElvinStaffCustomer SupportHi,
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
December 8, 2020 at 1:39 am #1571276KumarHi 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;
});”December 8, 2020 at 2:31 am #1571329DavidStaffCustomer SupportQuick question – which version of GenerateBlocks are you using ? Is it the latest 1.2 release?
December 8, 2020 at 2:47 am #1571346Kumaryes, thats right – Version 1.2.0
December 8, 2020 at 5:25 am #1571495DavidStaffCustomer SupportWhat happens if you use a Group Block ?
December 8, 2020 at 5:57 am #1571525KumarHi 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.
December 8, 2020 at 6:59 am #1571722DavidStaffCustomer SupportOk, 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.
December 8, 2020 at 7:52 am #1571771KumarHi 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?
December 8, 2020 at 10:08 am #1571895LeoStaffCustomer SupportYou would need to add the custom class to each block unfortunately.
February 12, 2021 at 3:55 pm #1656441ManuelHi
I am currently facing the same issue. The mentioned workaroundadd_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.February 12, 2021 at 4:39 pm #1656459LeoStaffCustomer SupportI 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; });
February 12, 2021 at 4:46 pm #1656460ManuelHello 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. -
AuthorPosts
- You must be logged in to reply to this topic.