Hi gotequity,
normaly not. But I think it could be possible, if you can access an easy-quotes gutenberg block on a page or a post to create your “shortode”/”block-shortcode”.
- Add an easy quotes gutenberg block
- configure all your settings
- switch to Code editor (On the screens upper right corner, right of the post/page “update” button, the 3 vertical dots. Switch from “Visual editor” to “Code editor”
Then you should see somthing like that.
<!-- wp:layart/quotes-block {"isShowStars":true,"isShowRating":true,"selectedFontsCategory":"4","fontFamily":{"family":"Hachi Maru Pop","version":"v10","category_id":"4","family_slug":"hachimarupop","variant":{"id":1,"file":"~ChAKDkhhY2hpIE1hcnUgUG9wIAAqBAgBGAE=.ttf"}}} /-->
Now you should be able to add this as “html” or with a template hook to your header.
I didn’t tested it, so if you try it, it would be nice to get some feedback if it’s working… 🙂
Have a nice day
Jürgen
Hi Jürgen,
I added an HTML file to my theme containing the widget code, which I’m calling with a php include statement in header.php. In testing, I discovered the quotes block is output to the header only when the widget is active on the same page – if the widget is deleted, moved to inactive, or present on another page, the quotes block fails to render.
Another approach I tested was to replace the widget code in my HTML file with the rendered HTML copied from page source. The good news it this method doesn’t require an active widget to render the quotes block, however the downside is that it only loops once.
If there was a way to infinitely repeat the loop using rendered HTML, this would be sufficient, however I don’t want to start manipulating core plugin files to achieve my objective. I’d certainly appreciate any thoughts or additional suggestions you can provide to make it work.
Thanks!
Nice, I think you are nearly there! 🙂
For me it works if I include the block-code like this in the header.php
echo do_blocks('<!-- wp:layart/quotes-block {"viewMode":"rotation","fontFamily":{"family":"Shadows Into Light","version":"v10","category_id":"4","family_slug":"shadowsintolight","variant":{"id":1,"file":"UqyNK9UOIntux_czAvDQx_ZcHqZXBNQDcsr4xzSMYA.ttf"}}} /-->');
Yes, this works perfectly. Thank you Jürgen!