I need to add a blue highlight effect to the active link text within the mobile nav menu (see screenshot). I don’t want to style the entire link, just the text. Is there a way to add a span within the link, perhaps directly in the php? Thanks you!
you could do that with the bricks/element/settings
filter. This will add a span to all text-link elements, but you might find a way to isolate them by adding a custom class/attribute and filtering out those, that don’t have the class/attribute.
add_filter('bricks/element/settings', function ($settings, $element) {
if ($element->name !== 'text-link') return $settings;
$text = $settings['text'];
$settings['text'] = "<span'>$text</span>";
return $settings;
}, 10, 2);
Cheers Suat
Thank you, @SuatB for your quick reply and solution! This somehow feels too complex just to add this effect to the mobile menu. I think I might need to look for a different solution.