- This topic has 10 replies, 2 voices, and was last updated 6 years, 3 months ago by Leo.
-
AuthorPosts
-
February 7, 2018 at 1:11 am #490173elsa
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?
February 7, 2018 at 9:22 am #490577LeoStaffCustomer SupportHi there,
Likely it’s because the conditional statement is wrong.
What are you trying to achieve?
Perhaps we can exclude certain pages instead?
February 7, 2018 at 1:41 pm #490793elsaHi 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?
February 7, 2018 at 2:04 pm #490818elsaHi 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?February 7, 2018 at 6:09 pm #490915LeoStaffCustomer SupportAhh 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?
February 7, 2018 at 8:40 pm #490979elsaFor 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?
February 7, 2018 at 9:34 pm #490987elsaHi 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 –>
February 8, 2018 at 8:46 am #491424LeoStaffCustomer SupportNot sure what you mean?
So you are going to use page header instead?
Where would you like to position that?
February 8, 2018 at 6:20 pm #491765elsaYes, 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.
February 8, 2018 at 6:49 pm #491783elsaHi, resolved. Thanks.
February 8, 2018 at 7:27 pm #491794LeoStaffCustomer SupportAwesome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.