I am trying to:
I have a view that displays a custom post type title with URL, followed by a taxonomy term (if it exists or blank if not), displayed in a list format separated by commas.
I created the view but in the list format I could only add one field so I added the title with URL. There was no content template and I don't really know what I'm doing so I added the taxonomy term field in the loop and set it to display just the term name. The whole loop code now reads:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-item index=other]
[wpv-post-link][wpv-post-taxonomy type="girl-promotion" format="name"],
[wpv-item index=last]
[wpv-post-link]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]
It's nearly ok but there is no white space between the post name and the term so it doesn't look right as you can see here:
Aylin, BeatriceNew, Belle, Carla, Carmen, ChloeNew, Claire,
If I add a space (by using my keypad so not any code) then I get this:
Aylin , Beatrice New, Belle , Carla , Carmen , Chloe New, Claire ,
....which gives me the space in between the title and the term, but annoyingly adds the space after post titles that are not assigned a term, so there's a horrible gap before the comma (after the post name where there's no term).
How can I fix this so the list displays as follows:
Aylin, Beatrice New, Belle, Carla, Carmen, Chloe New, Claire,
....therefore no gap after the post title and before the comma where there is no term, and a gap in between the post title and the term when it exists.
I thought this would be rally simple but for me it's not.
I've tried to also add a colour (red) to the term but all efforts failed. I know how to make it bold, by wrapping it with but that's all I can do with styling.
The absolute icing on the cake would be to have the URL to the post consist of both the post title and the term so a user won;'t get confused by one bit being clickable and one bit not.
I have tried to do this myself for over 4 hours but I currently can't get any further. Are you able to help please.
Many thanks,
Barry.
Link to a page where the issue can be seen: hidden link (please scroll down to the footer to see the list of girl's names in blue)
I expected to see: no gaps after girl names and before the commas and what the term name to be styled in red.
Instead, I got: a gap after the post title and before the comma (where there was no term).