I changed Theme > Links > css selectors by adding a filter in functions.php to completely override the default selectors. This worked and I could see the selectors in the theme links field and when inspecting the page.
However, I noticed that I had an error and so changed the filter but the change was not applied. I tried clearing the litespeed cache and my browser cache but the original selectors still showed. I tried making another change to the theme styling and saving to make sure the entire theme was rebuilt but this made no difference. I also tried removing the filter, saving and clearing caches but this made no difference.
So basically once you have changed the css selectors with a filter in functions.php, you canât change them again. So Iâm now stuck unable to resolve the issue. Thankfully this was on a staging site.
Also why do we have to write a function to do this? Why canât we just type into the links css selectors field to add or remove filters from the list? Doing anything in functions.php is risky for the site.
this really sounds like a caching issue or something similar. I just used the filter to target a specific link selector and was able to change it afterwards without any issues.
I have purged the litespeed cache numerous times and deleted the websiteâs cache and history from my browserâs website data and any change I make to the selectors in the function, the changes are never applied.
Iâd read a topic on a similar vein to this and Stefan was saying to make a change in the theme styles to force a rebuild of the theme. I did this but it made no difference. Trying this again, I changed something this time in the Links theme settings and this did flush the change through (so changing the Links css selectors in functions.php a second time seems to need something in the Links theme settings changing, not in any other theme style section). This really needs to be documented but surely you shouldnât have to do this.
It would be a lot easier if we didnât have to use a function and could simply edit the selector list itself in the themeâs settings.