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 1 year, 4 months ago by
Tom.
-
AuthorPosts
-
December 7, 2020 at 9:29 am #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
KumarDecember 7, 2020 at 12:07 pm #1570763David
StaffCustomer SupportHi there,
do they appear if you add the FAQ block to a normal page – ie. not in a container block?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 7, 2020 at 3:05 pm #1570925Kumar
Hi 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 #1571044Elvin
StaffCustomer 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
A wise man once said:
"Have you cleared your cache?"December 8, 2020 at 1:39 am #1571276Kumar
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;
});”December 8, 2020 at 2:31 am #1571329David
StaffCustomer SupportQuick question – which version of GenerateBlocks are you using ? Is it the latest 1.2 release?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 8, 2020 at 2:47 am #1571346Kumar
yes, thats right – Version 1.2.0
December 8, 2020 at 5:25 am #1571495David
StaffCustomer SupportWhat happens if you use a Group Block ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 8, 2020 at 5:57 am #1571525Kumar
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.
December 8, 2020 at 6:59 am #1571722David
StaffCustomer 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 8, 2020 at 7:52 am #1571771Kumar
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?
December 8, 2020 at 10:08 am #1571895Leo
StaffCustomer SupportYou would need to add the custom class to each block unfortunately.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 12, 2021 at 3:55 pm #1656441Manuel
Hi
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 #1656459Leo
StaffCustomer 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; });
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 12, 2021 at 4:46 pm #1656460Manuel
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. -
AuthorPosts
- You must be logged in to reply to this topic.