-
Notifications
You must be signed in to change notification settings - Fork 883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert FAQ titles to headings #11802
Comments
@Dieterrr More concrete:
|
Related: #10891 I'm afraid in the Edit view we'll have to keep the |
Issue moved to blocked as we're going to implement inner blocks in the same release. When that happens the headers in the FAQ block will be replaced by (inner) header blocks. Issue can be picked up again as soon as inner blocks are implemented, milestone is still aimed at 9.7. The current implementation has a small bug as it uses plain tags and it seems TinyMCE doesn't allow inline tagNames. This bug will not be fixed for now as it will be irrelevant when the innerblocks are introduced. |
Please inform the customer of conversation # 466418 when this conversation has been closed. |
Did this get addressed? We're on version 10. As a workaround, we've been replacing the strong tags with our desired header tag, which works, but it breaks the Gutenberg FAQ block and makes it no longer editable. |
Hi @advancedperiodontics, no, this has not yet been addressed. Unfortunately there is is no ETA available. |
Please inform the customer of conversation # 503324 when this conversation has been closed. |
Using headings also makes styling easier. I'm using the same CSS for |
This would indeed be very helpful. As an interim measure, is there a hook / filter that we could use to change it to a heading on the front end at least? |
Please inform the customer of conversation # 614659 when this conversation has been closed. |
Is there ANY update to this? It's an incredibly frustrating issue. |
Please! |
I've been including the following in my recent sites: <?php
function overdide_yoast_faqs($block_content, $block){
if ( 'yoast/faq-block' == $block['blockName'] ){
// This turns strong tags into h2 tags
return preg_replace('/<strong([^>]+)>(.*?)<\/strong>/','<h2\1>\2</h2>',$block_content);
}
}
add_filter( 'render_block', 'overdide_yoast_faqs', 10, 2 ); Hopefully soon this won't be necessary but it might help any of you in the short term. |
Not working for me 😱 Is this still valid? (I've introduced it in one of my functionality plugins not in the functions.php) |
@SirLouen, it's still working for me. If you post an example of the resulting html on your website (or a link) I might |
you need to use this, function overdide_yoast_faqs($block_content, $block){ |
Hello, thanks a lot for your reply. I tried to place your code but it can't save the functions.php file due to this error:
Here what I see when I save: https://gyazo.com/043ae9d383ab9a6303e82e6be621fbf0 |
hi, sorry, my mistake, last line should be add_filter( 'render_block', 'overdide_yoast_faqs', 10, 2 ); |
No problem! :) Now it's saved now. Unfortunately the function breaks the code and the FAQ don't show up anymore: https://gyazo.com/05a369a5d55d0f6c5e3248d0ee775bb9 |
interesting, it work for me. Is your code exactly this; // add h2 to yoast faq block function overdide_yoast_faqs($block_content, $block){ |
Yeah, it looks the same: https://gyazo.com/a6a2107e355920779b4a3261f4d2e0de You can have a look here. Strange yeah... |
try removing this line // This turns strong tags into h2 tags |
Done. Still nothing... |
no , I see it now, return preg_replace('/<strong([^>]+)>(.*?)</strong>/','<h2\1>\2',$block_content); this line is not the same in yours, you are missing the final |
some tags are being stripped out on paste here |
Added: https://gyazo.com/3bae4d2e3d8352adb68ec34162aba60c But still not showing up... |
compare that with yours |
Its not, you re missing a tag towards the end of line 884 |
compare line 7 on the image I posted, line 884 that you posted. it should be this
|
Great! It's working now 🥳 Thanks a lot for your time! |
hurrah! |
Please inform the customer of conversation # 767130 when this conversation has been closed. |
This is still a problem in the current version of Yoast (17.0). What's the ETA for a fix now? |
Please inform the customer of conversation #4409031 when this conversation has been closed. |
Please inform the customer of conversation # 908187 when this conversation has been closed. |
Please inform the customer of conversation # 969618 when this conversation has been closed. |
Maybe the following example helps someone: `function overdide_yoast_faqs($block_content, $block){
} Needed to add a Button to each FAQ. |
Currently the FAQ titles are rendered with
<strong>
tags.These need to be converted to headings.
Todo:
strong
toH{x}
headingThis issue is the quickest step to improving the rendering and results from our SEO analysis on pages which use an FAQ block.
Related: #11801
The text was updated successfully, but these errors were encountered: