Site logo

[Resolved] Need help to embed Block-Element via shortcode (NH-site)

Home Forums Support [Resolved] Need help to embed Block-Element via shortcode (NH-site)

Home Forums Support Need help to embed Block-Element via shortcode (NH-site)

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2562318
    Sascha

    Hello,

    on this site , I have created a Block-Element as a custom-hook-name “trainer1”, display on “Entire Site”.

    Then I added the following code to the child-themes function.php:

    function mb_shortcode1($atts, $content = null) {
          ob_start();
          do_action('trainer1');
          return ob_get_clean();
    }
    add_shortcode('trainer1_code', 'mb_shortcode1');

    Finally, on this page I have added the shortcode [trainer1_code] as the last content block, and expected the Block-Element to be displayed, but it does not work.

    Can you please help me troubleshooting this? Just in case I have admin-auto-login credentials in private notes field below.

    Thanks in advance and kind regards
    Sascha

    #2562324
    Fernando
    Customer Support

    Hi Sascha,

    That should work.

    We can’t view the element and the page in question since you’re currently on their edit pages. Once you’re done editing, let us know and we’ll re-check.

    #2562350
    Sascha

    Hi,

    oops, I have just closed the tabs for page & element, please go ahead 🙂

    Thanks
    Sascha

    #2562360
    Fernando
    Customer Support

    I see. You haven’t set a display rule location yet. You’ll need to add one first. 🙂

    #2562413
    Sascha

    Oh, it didn’t save it properly when I clicked update for the first time, now working perfectly, so thanks 🙂

    #2562422
    Fernando
    Customer Support

    You’re welcome, Sascha! 🙂

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