[Resolved] How to add shortcode into navigation

Home Forums Support [Resolved] How to add shortcode into navigation

Home Forums Support How to add shortcode into navigation

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #316541
    Blake

    I am having issues adding a beaver builder short code into the navigation menu. Currently I am using the following hook:

    add_action( ‘generate_inside_navigation’,’addnavshortcode’ );
    function addnavshortcode() { ?>
    [fl_builder_insert_layout slug=”header1″]
    <?php }

    The goal is to add beaver builder elements within the navigation tag above and below the menu listing.

    #316545
    Leo
    Staff
    Customer Support
    #316584
    Blake

    Thank you for the reply. The plugin that accomplishes this task is over 2 years old. To accomplish the task described above I was hoping this could be solved by inputting a small snippet of code through the Generatepress hook system. If this can be accomplished can I please receive assistance. If it is not possible an explanation of why would be very helpful.

    #316585
    Leo
    Staff
    Customer Support

    Can you try using the method here to execute the shortcode?
    https://generatepress.com/forums/topic/gp-and-beaver-builder-shortcodes-and-hooks/#post-216608

    Let me know.

    #316591
    Blake

    Thank you for the help. I incorporated the do_shortcode function as you suggested into my hook function. Now it works.

    <?php
    add_action( ‘generate_inside_navigation’,’addnavshortcode’ );
    function addnavshortcode() {
    echo do_shortcode( ‘[fl_builder_insert_layout slug=”header1″]’ );
    }
    ?>

    #316726
    Leo
    Staff
    Customer Support

    Thanks for the question 🙂

    Glad I could help!

    #316762
    lucas

    Good job i’m trying in my web site lucasarias.com

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