# Changing wordpress menu link color through wordpress customizer control not working

**URL:** https://forum.pinegrow.com/t/changing-wordpress-menu-link-color-through-wordpress-customizer-control-not-working/6534
**Category:** Pinegrow WP
**Created:** [May 14, 2022, 5:12pm UTC](https://forum.pinegrow.com/t/changing-wordpress-menu-link-color-through-wordpress-customizer-control-not-working/6534 "2022-05-14T17:12:44Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![dawidofski](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dawidofski](https://forum.pinegrow.com/u/dawidofski)
#### Post date: [May 14, 2022, 5:12pm UTC](https://forum.pinegrow.com/t/changing-wordpress-menu-link-color-through-wordpress-customizer-control-not-working/6534/1 "2022-05-14T17:12:45Z")

</div>

Hi guys,  
I ran into an issue:  
I am trying to add a wordpress customizer control for the text color of my primary menu. I tried 100s of different types of menu , but even with the simple menu below, the color won’t change once the wordpress menu is attached.

So when the menu tag is attachted, the customizer control for the text-color is displayed, but does not work.  
When i remove the menu tag, the customizer control for the text-control is displayed and works.  
(Basic) example menu:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/9/926e5fc5928eeb251502d278d944b784344d6ab1.png)  
Customizer settings

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/f/f17cb09b870fb7f54b4b236c47cc8ca6b48cd0ca.png)  
Menu settings:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/c/cd3b417e2d320bba62bb2a0424c950959ee0299a.png)  
Color not changing if menu is assigned:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/b/b2544fb58e3c2ac60091037ba340a196e6216762.png)  
Color changing when menu is not assigned:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/5/504c70e208b2a598eef9d130ac60402d1f426fb9.png)

Anyone who knows a workaround? I tried setting the customizer control to text, theme mod to style instead of display theme mod, set !important in the theme mod and more.

Seperate question/remark:  
Changing color of the a attribute only works when i put the customizer control directly on the a attribute.  
If i for example put my unorder list above in between header tags, and add a customizer control to edit the header text color, the a link will not change, even if i have no menu added. (example below). As you can see all other tags do change color when the i change the customizer control.  
Code:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/a/a7818666c2422547725514773dd2375799115b5e.png)  
Customizer control:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/8/80d1fb1373f9b3ca61043093c3e3c342966cfaad.png)  
Customizer example with header tag  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/d/dcefe6f54b8760c1eb25d9abf3280772b35d304c.png)

Sorry for the long wall of text and hope this makes sense!  
If anybody knows a workaround i would be forever gratefull as i have been struggling with this for weeks now.

Best regards,  
Dawid

---

<div class="post-metadata">

### Author: ![dawidofski](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dawidofski](https://forum.pinegrow.com/u/dawidofski)
#### Post date: [May 17, 2022, 4:18pm UTC](https://forum.pinegrow.com/t/changing-wordpress-menu-link-color-through-wordpress-customizer-control-not-working/6534/2 "2022-05-17T16:18:38Z")

</div>

Nobody? Perhaps someone with the same issue?

---

<div class="post-metadata">

### Author: ![dawidofski](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dawidofski](https://forum.pinegrow.com/u/dawidofski)
#### Post date: [May 20, 2022, 7:53am UTC](https://forum.pinegrow.com/t/changing-wordpress-menu-link-color-through-wordpress-customizer-control-not-working/6534/3 "2022-05-20T07:53:26Z")

</div>

@RobM, can you shine your light on this?

---

<div class="post-metadata">

### Author: ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)
#### Post date: [May 25, 2022, 9:57am UTC](https://forum.pinegrow.com/t/changing-wordpress-menu-link-color-through-wordpress-customizer-control-not-working/6534/4 "2022-05-25T09:57:45Z")

</div>

Hi @dawidofski,  
For a variety of reasons, I’m stepping away from my position at Pinegrow, but I still try to get on the forum when I can.

I _think_ you are going to have to use some custom PHP for this. Your menu set-up and customizer control would be the same. But then, you would have to add custom PHP that grabs the option or mod and translates it into a custom styling block that over-rides the styling on the links. If you use the DevTools, where is the styling on the links coming from?

Cheers,  
Bob

---

<div class="post-metadata">

### Author: ![dawidofski](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dawidofski](https://forum.pinegrow.com/u/dawidofski)
#### Post date: [May 25, 2022, 10:50am UTC](https://forum.pinegrow.com/t/changing-wordpress-menu-link-color-through-wordpress-customizer-control-not-working/6534/5 "2022-05-25T10:50:07Z")

</div>

Good afternoon @RobM ,  
Sorry to hear that, hope all is well!  
i think your knowledge really helped a lot of people so thank you for that.  
I wish you nothing but the best in your upcoming adventures 🙂

I haven’t put any css on any of the items on purpose, so there wouldn’t be any conflict.  
Looking at the dev tools i see it only inherits styles from normalize.css (part of the html template from pinegrow i started with

![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/e/ea3080a3fb10000c20d097e614c8a158e59544bf.png)

The rest of the styling comes from wordpress

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/6/6f65284b608e89da4ed1bbecfd1eadef95ccea5c.png)

Hope this is clear.  
Many thanks,  
Dawid

---

<div class="post-metadata">

### Author: ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)
#### Post date: [May 25, 2022, 11:07am UTC](https://forum.pinegrow.com/t/changing-wordpress-menu-link-color-through-wordpress-customizer-control-not-working/6534/6 "2022-05-25T11:07:06Z")

</div>

Hi @dawidofski,  
Can you actually show what styling the links have with and with-out the menu being assigned like at the top of your post. Not sure what classes are added to change the end styling.  
Cheers,  
Bob

---

<div class="post-metadata">

### Author: ![dawidofski](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dawidofski](https://forum.pinegrow.com/u/dawidofski)
#### Post date: [May 25, 2022, 11:21am UTC](https://forum.pinegrow.com/t/changing-wordpress-menu-link-color-through-wordpress-customizer-control-not-working/6534/7 "2022-05-25T11:21:00Z")

</div>

Hi @RobM sure,

The images in my reply above are when the customizer control is added, below are the screenshots when the customizer control is removed:

Normalize.css (same as screenshot in my other post)  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/6/6ddb94404d8560f28047483162c3f7c511b76177.png)

Wordpress styling

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/d/d5e0e0d954b5daab0a81d3d16dd62e6b0639837e.png)

Other (this is also the same with or without the control added)  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/d/dab6acabf18e00753a4f70a9f9cc6aa5e79797c6.png)

As far as i can see there is no difference between the styling added with or without the controller.  
I also tried to add the customizer control with custom php, and i have the same result (not working).  
I have searched google for hours but nobody seems to have (the answer to) this problem.

Let me know if i can provide any more information.

Thanks again!  
Dawid

---

<div class="post-metadata">

### Author: ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)
#### Post date: [May 25, 2022, 6:22pm UTC](https://forum.pinegrow.com/t/changing-wordpress-menu-link-color-through-wordpress-customizer-control-not-working/6534/8 "2022-05-25T18:22:52Z")

</div>

Hi Dawid,  
For you fourth and fifth images (colors with and without menu added), what is the computed styling difference of the links?

Two thoughts:

1. remove the generic a:-webkit-any-link color rule from the normalize.css (not sure if this is where the color is coming from or not)
2. For your custom php you are going to have to write out a style rule as opposed to adding inline styles. The style rules should target the link element, not the parental ul or div. Grab the theme mod or option and then add a style block to the body.  
Good Luck!  
Bob

---

<div class="post-metadata">

### Author: ![dawidofski](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dawidofski](https://forum.pinegrow.com/u/dawidofski)
#### Post date: [May 26, 2022, 11:39am UTC](https://forum.pinegrow.com/t/changing-wordpress-menu-link-color-through-wordpress-customizer-control-not-working/6534/9 "2022-05-26T11:39:09Z")

</div>

Hi @RobM, your response lead me to this link: [php - how to add color option in wordpress customize - Stack Overflow](https://stackoverflow.com/questions/36786520/how-to-add-color-option-in-wordpress-customize) , which basically solves the problem. (if anybody else runs into this issue)

Thanks a lot for your help!

---

<div class="post-metadata">

### Author: ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)
#### Post date: [May 26, 2022, 1:06pm UTC](https://forum.pinegrow.com/t/changing-wordpress-menu-link-color-through-wordpress-customizer-control-not-working/6534/10 "2022-05-26T13:06:05Z")

</div>

Yeah, the top answer there is my suggestion number 2.  
Glad it worked out for you!
