Skip Navigation

[Resuelto] Split: taxonomy term question

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

Problem:
How to show a term meta field when listing posts.

Solution:
Term custom fields can only be shown when querying terms. When displaying posts which have taxonomy terms assigned, to output term fields for the taxonomy terms it is necessary to create a taxonomy View to list the terms belonging to the current post (that condition specified as a Query Filter) and then to output the term field in the Loop Output section of that View.

It may make sense to use the option to display the View without any wrapper div (and possibly to remove unnecessary whitespace from the Loop Output).

This support ticket is created hace 6 años, 1 mes. 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Este tema contiene 9 respuestas, tiene 2 mensajes.

Última actualización por Akhil hace 6 años, 1 mes.

Asistido por: Nigel.

Autor
Mensajes
#1133610

ok this seems to be solved, pls if you have time look into this too : i need the tax-color-code raw value to be next to the category , pls look here at line 25
enlace oculto

#1133617

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

Can you confirm which archive this is for? (It is determined by the Layout which uses this archive, and I'm not sure which that is.)

If you give me a front-end link of where I can see the problem I'll know.

#1133634

Hi. its every page that display archive list.

enlace oculto

or enlace oculto

you can its category name sample: : "Foods–rise-blog" i need the color code to be there in raw [with no spaces/characters]

Foods–rise-blog -#00000 etc. thanks !

#1133640

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

This is the bit I'm looking at, yes?

      <div class="rise_cat_meta cat_meta_[wpv-post-taxonomy type="rise-blog-category" format="slug"]">
       [wpv-post-taxonomy type="rise-blog-category"]-[taxonomy output='field' field='wpcf-tax-color-code']
       </div>

The problem is one of context.

The custom taxonomy shortcode context is the archive page itself, i.e. the term is determined by the URL (if it exists).

You want to output the term field for individual posts (and the term field belongs to terms, not posts).

To output the term field for a post you need to create another View—a taxonomy View which lists the terms for the current post and which outputs the term field for the term—and insert this View nested inside your first View where you want to output the term field.

Don't forget to set the option in the taxonomy View to output it without any wrapper div.

#1133643

i think i did try that before too. let me double confirm in a sec.

#1133644

ok ive added the view, –– [wpv-view name="tax-term-tax-color-code-view"] you can see the output is

–– #bc8f8f

i need it raw '#bc8f8f'. thats the problem i face. u can use the current view output. hope its clear.,

#1133645

this is the view enlace oculto

#1133646

insert this View nested inside your first View where you want to output the term field. : these i might not have followed. not sure how too .

#1134184

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

I edited your View and I removed all the whitespace from the Loop Editor, and I also removed the wpv-filter-meta-html shortcode from the Output Editor (because this View doesn't include any filter controls) and the View itself seems to be outputting just the colour hex code.

#1134242

Thanks, Youre genius !
i didnt think of this ,sound logical,

My issue is resolved now. Thank you!