Skip Navigation

[Resuelto] Visibility when there are no products associated with taxonomy object

This support ticket is created hace 5 años, 8 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Este tema contiene 8 respuestas, tiene 2 mensajes.

Última actualización por ellenB hace 5 años, 8 meses.

Asistido por: Christian Cox.

Autor
Mensajes
#1213859

I am building an online bookstore and I have the authors set up as a taxonomy for the Products. I have an Authors page which displays a View of all of the Author Taxonomy items (enlace oculto) and each photo and name is linked to the individual Author page which I have set up under the WordPress Archive template.

If the Author has a book in the shop that they are associated with, their Author page loads fine. Example: enlace oculto

If the Author does not have a book in the shop, their Author page loads blank. Example: enlace oculto

It makes sense that whatever is in the loop would not show up if nothing is returned but their photo and bio are set up outside of the loop via an imported Content Template.

Here is my WP Archive Loop Editor:

[wpv-layout-start]
[wpv-post-body view_template="content-template-for-authors"]
<div class="upper-title">Books by this Author</div>
[wpv-items-found]
<!-- wpv-loop-start -->
<div class="grid">
<wpv-loop>
<div class="related-prods">
<div class="product-img">

[wpv-woo-product-image size='shop_single' output='img_tag' enable_third_party_filters='no' gallery_on_listings='no']
[wpv-woo-onsale]

</div>
<div class="prod-title">
[wpv-post-link]
</div>
<div class="prod-tax">
by [wpv-post-taxonomy type='authors']
</div>
</div>
</wpv-loop>
</div>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<h2>No items</h2>
[/wpv-no-items-found]
[wpv-layout-end]

My goal is that for all authors (and for all taxonomies - I am having this problem elsewhere), that the content outside of the wpv-loop (in this case, the photo and bio) will show up regardless of whether or not there are items in the loop.

The site is password protected during development, the username is demo and password is cincopuntos.

#1213929

That's odd, I was just investigating this on your site and it started working. I switched from the child theme to the parent Genesis theme, and it started working. Then I switched back to the child theme and it is still working...I can see the "Books by this Author" text appear. Coincidence, or were you also making changes?

#1213939

That is odd. I see some changes to other WP Archives after the theme selected was changed and then back. I was not working on the site.

Can I put a content template into the loop (e.g. have it show up in both the wpv-items-found and the wpv-no-items-found)? I want the photo and bio to show up regardless. I just tried that now and it didn't work but thought there may be a different way to include it. I was able to put the title into the two sections without any problems.

#1213944

In your case, it looks like Content Templates are not working well in the Archive's Loop Editor. I was able to place the content from the Content Template directly inside the Loop Editor, and it seems to be working now. Can you take a look?

#1213970
archivelayout.png
wooviews.png

I am seeing the photo and bio now (thank you!) - I traced this back to the Woocommerce View templates settings - I didn't originally have them both set to Toolset > Woocommerce Views.

My remaining issue is that the two of the three taxonomy archives (Illustrators and Translators Detail page) are not displaying like the third (Authors Detail page). I have the Archive Layout on both set to Full Width Content.

Examples:

Author: enlace oculto
=> Displaying correctly.

Illustrator: enlace oculto
=> Unwanted sidebar and extra bio showing up above the content.

Translator: enlace oculto
=> Unwanted sidebar.

I don't see any difference between the two WordPress Archives (Author Detail page) and (Illustrator and Translator Detail page). What am I missing?

#1213979

I resolved the extra bio (taxonomy description). It was coming from line 819 in the wc-template-functions.php file in woocommerce. I removed it by adding the following to functions.php:

remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );

#1214240

My remaining issue is that the two of the three taxonomy archives (Illustrators and Translators Detail page) are not displaying like the third (Authors Detail page). I have the Archive Layout on both set to Full Width Content.
I don't see anything in the WordPress Archive that would be causing this. Since that View is used in the Blog Sidebar widget, my guess is there's a sidebar registration issue or something going on in the custom theme files. I tried switching back to the parent Genesis theme temporarily to do some troubleshooting, and now that I've switched back to CincoPuntos everything looks...different. What do I need to do to revert to how it was before I switched to the parent theme?

#1214372

Yeah, switching back and forth between themes has a tendency to mess up the settings and the widgets. I can revert it to the backup. I was hoping to track down the specific issue and fix it but for now I'll just use display: none to hide them. Thanks for your help!

#1214373

My issue is resolved now. Thank you!