[Resolved] Custom Logo Link

Home Forums Support [Resolved] Custom Logo Link

Home Forums Support Custom Logo Link

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #490173
    elsa

    Hi,
    I want to have different link for each different logo in the header. So I use following in child theme functions.php

    // LOGO LINK

    add_filter( ‘generate_logo_href’,’generate_add_custom_logo_href’ );
    function generate_add_custom_logo_href()
    {
    if ((is_woocommerce() && is_product_category(kids)) ||
    (is_product_category( array( ‘kids’, ‘kids – bath’, ‘kids – toilet’, ‘kids – bedding’, ‘Baby Bedding’, ‘Baby Blanket’, ‘Infant Pillow’, ‘Kids Bedding’, ‘Kids Blanket’, ‘Kids – Decor’, ‘Kids – Canopies’, ‘Kids – Decorative Accents’, ‘Kids – Bank’, ‘Kids – Cushions & Pillows’, ‘Kids – Plates & Utensils’, ‘Kids – Plates’, ‘Kids – Wall Art’, ‘Kids – Canvas Wall Art’, ‘Kids – Wall Decals’, ‘Kids – Decor’, ‘Kids – Wall Decor’, ‘Growth Charts’, ‘Kids – Mirrors’, ‘Kids – Wall Hangings’, ‘Kids – Furniture’, ‘Playroom’, ‘Infant Chairs’, ‘Pools & Pits’, ‘Kids – Lighting’, ‘Kids – Floor Lamps’, ‘Kids – Night Lights’, ‘Kids – Rugs & Windows’, ‘Kids – Rugs’, ‘Boys’ Rugs’, ‘Girls’ Rugs’, ‘Nursery Rugs’, ‘Kids – Storage’, ‘Kids – Bins & Baskets’, ‘Kids – Shelves’, ‘Safety’, ‘Corner Protectors’, ‘Door Stoppers’, ‘Edge Protectors’, ‘Safety Locks’, ‘Toys & Gifts’ ) )))
    return ‘http://myweb.com/kids’;
    }

    But it redirects to the same page I currently open. What is wrong?

    GeneratePress 2.0.2
    GP Premium 1.5.6
    #490577
    Leo
    Staff
    Customer Support

    Hi there,

    Likely it’s because the conditional statement is wrong.

    What are you trying to achieve?

    Perhaps we can exclude certain pages instead?

    #490793
    elsa

    Hi Leo,
    I want to have different link for each header. My website consists of 2 big topics: adult & kid. Every topic has its own header, every header has its own logo. So it’s like:

    1. Topic A – Header A – Logo A. Relevant page & product page: A1, A2, so on. Logo link: myweb.com

    2. Topic B – Header B – Logo B. Relevant page & product page: B1, B2, so on. Logo link: myweb.com/kids

    How to do this?

    #490818
    elsa

    Hi Leo,
    Can I use image link under header setting for this and upload transparent image for every header? How do I align the transparent image with logo that I upload on the header setting?

    #490915
    Leo
    Staff
    Customer Support

    Ahh you were using the wrong filter. That one is for logo link.

    To swap out for different logo, this is the one you need: https://docs.generatepress.com/article/generate_logo/

    What’s the logic in topic A and B? Are they categories?

    #490979
    elsa

    For logo, I can generate different logo for each header.

    Topic B consists of products that categorized under “Kids”; and also pages.

    Similar logic apply to Topic A. How to do conditional to link 2 header logos to 2 different pages?

    #490987
    elsa

    Hi Leo,
    I resolved this by creating ahref for site title on header setting. But now my title positioning is not correct. How to position this?

    <!– page header –>

    <p class=”main-title” itemprop=”headline”>

    Spruce Up Space!

    </p>

    #491424
    Leo
    Staff
    Customer Support

    Not sure what you mean?

    So you are going to use page header instead?

    Where would you like to position that?

    #491765
    elsa

    Yes, I decided to use page header setting to make the grouping easier. I want to position the site title in the center above navigation menu.

    #491783
    elsa

    Hi, resolved. Thanks.

    #491794
    Leo
    Staff
    Customer Support
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.