• Resolved gotequity

    (@gotequity)


    Hi Jürgen,

    I’m interested in using this in the header of an older theme that isn’t built on blocks. Is there an option to integrate via shortcode or template tag?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jürgen Müller

    (@juergen74)

    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

    Thread Starter gotequity

    (@gotequity)

    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!

    Plugin Author Jürgen Müller

    (@juergen74)

    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"}}} /-->');
    Thread Starter gotequity

    (@gotequity)

    Yes, this works perfectly. Thank you Jürgen!

    Plugin Author Jürgen Müller

    (@juergen74)

    Cool! 🙂 Glad it works!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.