Hi, I've tried various snippets of code to try to get this working on my Wordpress site but without success. I have a structure:
<div class...>
<ul>
<li class...><a href... </li>
<li class...><a href... </li>
<li class...><a href... </li>
</ul>
</div>
I am trying to add an additional class to the containing li if the a href contain '/project/' somewhere within it.
This is the code I have tried + various other permutations without success. The JQuery is in a linked js file which I know is linked correctly as I have checked via a simple alert:
- jQuery(document).ready(function($){
- $('li.bawmrp_manual').find('a[href*="/project/"]').addClass('bawmrp_gallery');
- })
Can anyone assist?