Saltar navegación

[Resuelto] Taxonomy Views inside WordPress archive

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

Problem:

The issue here is that the user wanted to have a taxonomy view inside a custom archive.

Solution:

This is actually possible and Details on how to achieve this can be seen in the link below.
https://toolset.com/forums/topic/taxonomy-views-inside-wordpress-archive/#post-1209657

This support ticket is created hace 5 años, 10 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.

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

Supporter timezone: America/Jamaica (GMT-05:00)

Este tema contiene 9 respuestas, tiene 2 mensajes.

Última actualización por Pat hace 5 años, 10 meses.

Asistido por: Shane.

Autor
Mensajes
#1209232

Pat

Hello,

I have created a custom taxonomy (intervenant) including some custom fields and wants to display those fields inside a WordPress archive page.

So, I created a new content template for the 'intervenant' archive.

In order to retrieve the right info, I have also created a taxonomy Views for 'intervenant'. In this Views, I have set up the different needed fields.

Now, I'm trying to insert this Views inside the archive content template but did not succeed to define the right filter to apply to the Views.

The url of the archive is : enlace oculto and I tried several different parameter on the taxonomy Views without success (defined by the current post or define by the page where the Views is integrated ...)

Can you help on this?
Regards
Pat

#1209514

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Pat,

Sure no problem.

Could you provide access to this site if possible ?

As well as a link to the archive in question?

Thanks,
Shane

#1209515

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Private fields

#1209585

Pat

Hi Shane,

Sorry but this is concerning a client's site and I'm not able to give you access.
Can you provide some guidelines in order to check if I have used the right parameters ?
Thanks
Pat

#1209657

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Screenshot 2019-03-04 at 2.06.15 PM.png

Hi Pat,

No problem lets see how best we can work with this info.

So On your taxonomy view you want to essentially list out the taxonomy fields of the taxonomy that is assigned to the post that the archive is looping through.

You will need to add a query filter for Taxonomy Term filter and set that filter to current post see screenshot

What happens if you add the taxonomy title to this view using this shortcode [wpv-taxonomy-title] does the title display? or are you getting No results found.

Please let me know.
Thanks,
Shane

#1209759

Pat

Hi Shane,

Then I'm getting no item found !

I have also tried with the first possibility (Set bu the page where the Views is inserted) and here, I'm getting 4 results (including the right one).

If I chose "Terms with the ID defined by a shortcode", then no item found.

If I chose the "One of these" possibility and place the name of the one I want to display, then, I'm getting the right one and only this one!

Here is my code in the Views archive (the taxonomy Views is "presentation-dun-intervenant" . I can say that the loop in this Views is working well, meaning the results are really those linked with the dedicated "intervenant":

[wpv-layout-start][wpv-view name="presentation-dun-intervenant" terms="[wpv-post-title]"]
[wpv-items-found]

<!-- wpv-loop-start --><div class="col-sm-12"><h3>Les événements ou intervient [types termmeta='prenom-intervenant'][/types] [wpv-post-taxonomy type="intervenant" format="name" item="$parent"]</h3>
<wpv-loop wrap="4" pad="true">
[wpv-item index=1]
<div class="row ">
<div class="col-sm-3">[wpv-post-body view_template="loop-item-in-archive-pour-intervenants"]</div>
[wpv-item index=other]
<div class="col-sm-3">[wpv-post-body view_template="loop-item-in-archive-pour-intervenants"]</div>
[wpv-item index=4]
<div class="col-sm-3">[wpv-post-body view_template="loop-item-in-archive-pour-intervenants"]</div>
</div>
[wpv-item index=pad]
<div class="col-sm-3"></div>
[wpv-item index=pad-last]
<div class="col-sm-3"></div>
</div>
</wpv-loop></div>
<!-- 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]

Regards
Pat

#1210042

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Pat,

I'm a little confused. This is a CPT archive correct?

And you want to list the taxonomy terms of each of the individual posts that are being displayed by this archive?

Please confirm this as your current setup will not give you this information and I can see why you are getting the no items found.

Thanks,
Shane

#1210179

Pat

Hi Shane,

Sorry if I have not been clear.

First, the taxonomy (intervenant) is linked to the WC products.
What I want to do is the following :

- When someone clicks on a taxonomy link, he is redirected to the taxonomy page.
- On this page, I want to display some terms field of this taxonomy and the list of products that are have this taxonomy.

If I'm right, the archive taxonomy Views will display the products related to the taxonomy and this is working. What I searching for, is to display the taxonomy terms fields in top of this page.

Let me know
Regards
Pat

#1210184

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Pat,

Thank you for the clarity let us work on this in steps.

First, the taxonomy (intervenant) is linked to the WC products.

Do you already have this working ?

When someone clicks on a taxonomy link, he is redirected to the taxonomy page.

Is this already working ?

- On this page, I want to display some terms field of this taxonomy and the list of products that are have this taxonomy.

When you click the taxonomy link it should already take you to the taxonomy archive that will already be listing out the appropriate products. So what you need is to display the custom fields of that taxonomy correct?

I need to know the step that you are stuck on.

Please let me know.
Thanks,
Shane

#1212405

Pat

Hi Shane,

After looking again this issue, it seems I had not made it the right way. I made some evolution and now, everything is working fine.
Sorry for using your time and thanks for helping.
REgards
Pat