Adding Link to Label in PHP
-
Hi all,
I am working with a template that displays the custom taxonomy “Tracks” under “Sessions.” These appear as a label, as you can see above. I’d like the labels to link to all the sessions tagged with the same. This is the PHP I am working with:
<span data-track="<?php echo $track->term_id; ?>" class="label single-session-link btn btn-primaryd<?php if (empty($track->color)) echo " bg-gold"; ?>" <?php if (!empty($track->color)) echo "style='background-color: $track->color;'"; ?>><?php echo $track->name; ?> </span>I am trying to add “get permalink” and direct it to the slug but I am really not well versed in writing PHP. Please assist.
- This topic was modified 6 years, 8 months ago by .
- This topic was modified 6 years, 8 months ago by . Reason: code fixed
The page I need help with: [log in to see the link]
The topic ‘Adding Link to Label in PHP’ is closed to new replies.