[Support request] Changing Header Link

Home Forums Support [Support request] Changing Header Link

Home Forums Support Changing Header Link

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #289574
    David

    I really want to change a link within my header, I am working on a food website which wants an ‘Order Now’ link. And i was hoping to change the coding so it pops straight to their site, but when i go into the Editor section I can not seem to find where i can change the coding.

    Can anyone help.

    GeneratePress 1.3.44
    #289582
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    So you’re wanting to change the URL your logo points to?

    If so, this filter should help: https://docs.generatepress.com/article/generate_logo_href/

    An example can be found here: https://generatepress.com/forums/topic/change-default-url-logo/#post-287472

    #289592
    David

    So sorry, i dont mean my logo but actual menu paths.

    http://a20.c48.myftpupload.com/home1/

    I have an order now. But i want that to be link to the order system they have set up with a company that had given me a link for a button. But its ugly and doesnt look good where i have tried placing it.

    #289624
    David

    So sorry, i dont mean my logo but actual menu paths.

    http://a20.c48.myftpupload.com/home1/

    I have an order now. But i want that to be link to the order system they have set up with a company that had given me a link for a button. But its ugly and doesnt look good where i have tried placing it.

    #289721
    Leo
    Staff
    Customer Support

    Hi David,

    Looks like you are on the right track of using the Custom Links in the menu?
    Just need to figure out where their Order Now button links to and add the same URL in your Custom Link?

    Let me know if this answers your question.

    #290225
    David

    HI Leo thats my problem they dont have that…just a button

    <!– If you would like to customize the button, remove or change the “class” attribute inside the <span> tag –>
    <span class=”glf-button” data-glf-cuid=”8989e330-ed1a-40fe-a7ed-1f955c2bcdd4″ data-glf-ruid=”7478bc11-2495-45d8-9a86-5c92e43a21f1″ data-glf-auto-open=”false”> See MENU & Order</span>
    <script src=”https://www.foodbooking.com/widget/js/ewm2.js&#8221; defer async ></script>

    Which looks ugly to be honest and im wanting to create a better look for my site.

    #290226
    Leo
    Staff
    Customer Support

    Sorry where are you adding this code right now?

    I don’t see it on this page: http://a20.c48.myftpupload.com/

    Am I missing something?

    #290227
    David

    I am wanting to add it to my title list, so where it says ‘Order Now’ i would love to have that as the link to where this button does take you.

    The only place right now this button is being used is in the locations, with Robson.

    #290230
    Tom
    Lead Developer
    Lead Developer

    Hmm, to add HTML with attributes like that you would have to hook it into the navigation.

    Something like this:

    add_action( 'generate_inside_navigation', 'tu_add_html_button_to_nav' );
    function tu_add_html_button_to_nav()
    {
        ?>
    	<div class="custom-order-button hide-on-mobile">
                Your code in here
            </div>
        <?php
    }

    Then some CSS:

    .custom-order-button {
        float: right;
    }
    #290233
    David

    I have put this coding in the hook, but the coding appears as text!

    I copied and pasted what you put as well, so dont know what I have done wrong :S

    #290234
    David

    Parse error: syntax error, unexpected ‘}’ in /home/content/p3pnexwpnas07_data01/21/3597921/html/wp-content/plugins/gp-premium/hooks/functions/hooks.php(22) : eval()’d code on line 10

    Thats the code i get on the site!

    #290235
    Leo
    Staff
    Customer Support

    Hi David,

    Just want to make sure the the code Tom provided is added in the right place.

    The first part of code should be added in code snippet: https://docs.generatepress.com/article/adding-php/

    The second part is CSS: https://docs.generatepress.com/article/adding-css/

    Let us know.

    #290237
    David

    Its not working, Its got the text of “See Menu” but the link isnt working and the look and feel isnt going in the right direction.

    Just to be 100% is there no way I can manipulate the coding so that the word “ORDER NOW” in my menu will take me to the function of the button with out having an ugly button!

    BTW thank you so much for helping!

    #290254
    Tom
    Lead Developer
    Lead Developer

    Since the HTML they’re providing isn’t even a link, it won’t work by adding it as a menu item I’m afraid (as those are all links).

    You also can’t add it as a custom link, as WP custom links don’t allow for all of the custom attributes that element has.

    The best bet is the method I mentioned, which might need to be styled with CSS.

    If the link itself wasn’t even working with that method, there might be something wrong with the code itself.

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