Add account link to the rendered menu area

After the update the structure of the menu was changed. This is a problem, because I relied on this snippet that I’ve gotten from the dev docs to render the hivepress functions in my navbar:

if (function_exists('hivepress')) {
                echo hivepress()->template->render_menu();

Before, this snippet was enough to import the hivepress functionalities together with my custom built navbar. Now, My Profil/ My Account is missing from this, and I need a snippet to insert it again.

Thank you

If you want to bring back the old account link please try filtering the hivepress/v1/templates/site_header_block to insert a new part block with user/login/user-login-link path. We’ll probably add a snippet to our Gist collection because there are a few complaints about a new link.

Okay, ill wait for the snippet. Im not too crafty in php.

However, I would like the functionality of a dropdown, just have it placed together with the buttons.

If not possible, maybe you can provide me with a way to render det different account menu items, like listings, request, favorites etc, and I can create a custom dropdown

We’ll try to find a solution for this, it’s pretty complex because the drop-down script and styles are not applied outside of the menu area, and we can’t duplicate the drop-down script because currently the drop-down also works with any third-party themes (since all the themes implement drop-down menus).

A temporary snippet would move the link to the buttons area, but the drop-down feature wouldn’t work. Rendering the account menu directly in the code would require further code changes, please consider waiting for the next update - we’ll probably find a way to fix this because this issue affects our themes with centered menus.

I see. Thanks for the update.

I’m thinking of making a complete custom navbar. Is there an easy way to render the hivepress account menu items?

You can render them using the code snippet posted above, but to add the old account link to this area this code snippet is required Log in and register button is gone - #4 by ihor

Ah my bad, I misunderstood.

What I am trying is rendering the menu content specific to the current user account - the content that is dynamic, like dashbord, and showing favorite link in the menu if you have atleast one favorite added, and log out in the bottom.

Is there some parameters i can add to the above function to only dig into the hivepress menu content and slap it into my own wrapper?

Thank you for your patients

If you mean the account menu itself, it can be rendered this way:

echo (new \HivePress\Menus\User_Account())->render();

1 Like

Beautiful, Thank you!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.