Skip Navigation

[Resuelto] Creating class for each multiple taxomonies field

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

Output term's link with customized CSS class name.

Solution:

you create another taxonomy view, list terms of taxonomy, filter by:
Taxonomy is set by the current post

In section "Loop Editor", display the term's link like this:

...
    <wpv-loop>
        <a href="[wpv-taxonomy-url]" class="cat_meta_[wpv-taxonomy-slug]">[wpv-taxonomy-title]</a>
    </wpv-loop>
...

Use above view as child view of the post view you mentioned above. and test again.

Relevant Documentation:

This support ticket is created hace 6 años, 6 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Este tema contiene 3 respuestas, tiene 2 mensajes.

Última actualización por Luo Yang hace 6 años, 6 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#902290

Hi, i m trying to have some class to design my blog page.

i manage to do it for simple single tax but the issue is when i have multiple categoriers, i need to style them both in diffrent color.

i read that i need to create new view and insert inside, i only get the first category, nothing more.
next i some custom snippets/js code.

my normal code that works for single tax. :

<div class="cat_meta_[wpv-post-taxonomy type="blog-category" format="slug"]">
       [wpv-post-taxonomy type="blog-category"]
       </div>

my views that i tested:

 <ol>
       [wpv-for-each [wpv-post-taxonomy type="blog-category" ]
       <li>[wpv-post-taxonomy type="blog-category"]</li>
       [/wpv-for-each]
  </ol>

i m very sure this code is wrong as tehre is no such thing as wpv-for-each for taxomonies ?
appreciate all guide.

#902306

Hello,

I suggest you create another taxonomy view, list terms of taxonomy, filter by:
Taxonomy is set by the current post

In section "Loop Editor", display the term's link like this:

...
	<wpv-loop>
		<a href="[wpv-taxonomy-url]" class="cat_meta_[wpv-taxonomy-slug]">[wpv-taxonomy-title]</a>
	</wpv-loop>
...

Use above view as child view of the post view you mentioned above. and test again.

#902672

Thanks.

#904718

You are welcome