[Resolved] Block Hook makes Menu disapear

Home Forums Support [Resolved] Block Hook makes Menu disapear

Home Forums Support Block Hook makes Menu disapear

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1962768
    troyw

    Hey guys,

    I have added a Block Hook to add a row of 5 buttons to my Home Page Header. The only Hook I could find to add this was the Hook Name ‘Header’. Problem is, this makes the Menu disappear? I’ve tried lots of Hook Names, but can’t seem to find one that keeps the menu and allows me to position the buttons where I want them.

    Another issue I am having is that I can’t seem to force the buttons to be the same size. How do I make them all conform to one size, as they are now changing depending on the text length?

    Thanks

    #1962782
    Leo
    Staff
    Customer Support

    Hi there,

    Let’s handle one issue at a time.

    Selecting “Header” in the hook would replace the actual header of your site.

    Where are you actually trying to add the buttons?

    #1962796
    troyw

    Hey Leo,
    Yes, I am trying to add the buttons to the header. The header itself is a Header Element.

    #1962798
    Elvin
    Staff
    Customer Support

    Hi there,

    To clarify, are you trying to hook in a Block Element inside a Header element?

    If that’s the case then that’s not possible w/o some workaround because there are no hook locations inside a Header Element. you’ll have to create a hook location inside manually.

    You can add it manually using a shortcode.

    See the add_shortcode snippet in this reply – https://generatepress.com/forums/topic/hook-in-hook/#post-1636333

    With this, you can create a hook location anywhere on the site, meaning you can hook a Block element or Hook element anywhere. 😉 (in your case, add a shortcode inside the Header Elements code area)

    Another issue I am having is that I can’t seem to force the buttons to be the same size. How do I make them all conform to one size, as they are now changing depending on the text length?

    This can be done with CSS. Can you link us to a sample page?

    A wise man once said:
    "Have you cleared your cache?"

    #1962804
    troyw

    Hey Elvin,

    I will check out the add_shortcode link you sent.

    The buttons are the ones I am trying to Hook over header on the Home Page. As you can see, they are all different widths.
    Valves, Fittings, Hose, Filtration and Measurement

    #1962807
    Elvin
    Staff
    Customer Support

    The link is in maintenance mode. can you provide us access to check?

    The buttons are the ones I am trying to Hook over header on the Home Page. As you can see, they are all different widths.

    by “over header” did you mean before the Header element? If that’s the case then the shortcode won’ be necessary. You only need to hook the buttons to generate_after_header and then set the priority value to 1 so it goes before the Header element (Header elements have priority of 5.)

    A wise man once said:
    "Have you cleared your cache?"

    #1962810
    troyw

    Hey Elvin,
    Sorry mate, read that ‘add_shortcode snippet post’ and it makes no sense whatsoever to me.

    Firstly, does the code snippet go in the functions.php file?

    As for the rest, I have no idea how that relates to my Block Hook?

    Thanks

    #1962813
    troyw

    Check link now

    #1962817
    troyw

    Aha,
    Yes, changing the Hook to after_header and the priority to [1] seems to have done it.
    Thanks.
    So to force those buttons to be the same size, what do I need to do?

    #1962821
    Elvin
    Staff
    Customer Support

    Try this setting for all the buttons – https://share.getcloudapp.com/NQu7qwoD

    A wise man once said:
    "Have you cleared your cache?"

    #1962835
    troyw

    Hey Elvin,

    That’s much better. I had to change the Right and left spacing to 10 instead of 20, but it seems much better than it was, thanks.
    I can fine tune it now, so thanks for advice.

    Have a great day.

    #1962839
    Elvin
    Staff
    Customer Support

    No problem. Glad to be of any help. 😀

    A wise man once said:
    "Have you cleared your cache?"

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