Skip Navigation

[Resolved] Taxonomy Views not working while on Specific Parametric Search Page

This thread is resolved. Here is a description of the problem and solution.

Problem:
Taxonomy Views not working while on Specific Parametric Search Page

Solution:
You can find the proposed solution in this case with the following reply:
https://toolset.com/forums/topic/taxonomy-views-not-working-while-on-specific-parametric-search-page/#post-2260067

Relevant Documentation:

This support ticket is created 2 years, 3 months ago. 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by nedG 2 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#2255643

I have created 2 Taxonomy views which appear in my UBERMENU navigation bar on my site. They are nested.

The first Taxonomy View is of all TOP LEVEL beer categories.
The second Taxonomy View of all beer categories belonging to each TOP LEVEL beer category (nested).

You can see it in action on the website... hidden link and simply hover over the OUR BEER navigation link and see all of the taxonomies and sub-taxonomies

It works great.

However, when I navigate to this page.... hidden link ... those taxonomy views break. They no longer display the secondary taxonomy view.

What am I missing?

#2255863

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Not sure whats going wrong there. I will have to review your setup.

Can you please share admin access details and tell me how exactly you setup the menu and added the views to that menu?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2258651

Any status on this?

#2258905

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've created the following test page and I can see the nested taxonomy view is working just fine:
=> hidden link

I'm not sure yet why its not working on especially "Our Beer" page. There must be some conflict that causes nested view not working on "Our Beer" page.

I see on other page as well the nested taxonomy view is working with "Our Beer" menu:
=> hidden link

It seems to me there is something on the "Our Beer" page that overrides the nested view loop or there could be some other conflict.

If you can share duplicator copy of your site I will try to check and debug the issue further as we do not recommend to debug the issue on production sites.
=> https://toolset.com/faq/provide-supporters-copy-site/

I have set the next reply to private which means only you and I have access to it.

#2259345

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I tried duplicator but seems there is some restrictions on your server that I could not able to build duplicator package.

Then I've installed ALL In one WP Migration plugin and somehow it seems I can able to build the package but when I try to download it its really really slow. After 15 minutes I can only able to download 2MB.

Then I try another way to download, I though let me download it using FTP/SFTP and see it that works but shared FTP/SFTP access details is not working.

Can you please send me all in one migration package:
You will find that at path: wp-content/ai1wm-backups/www.pleasurehousebrewing.com-20220105-161156-lqzhd7.wpress

You can upload it on any file sharing service and send me link to download it.

I have set the next reply to private which means only you and I have access to it.

#2260067

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

When I debug it was not displaying the child terms on the "Our Beer" page because somehow the parent always set to 0. Some queries override it and we do not have any control over there.

So, as a workaround, I've added the following code on "Custom Code" section offered by Toolset:
=> hidden link

function func_display_view_output($atts) {
  
global $wpdb;
  
$sql = 'SELECT  t.*, tt.* FROM '.$wpdb->prefix.'terms AS t  INNER JOIN '.$wpdb->prefix.'term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ("beer_style_type") AND tt.parent='.$atts['ptid'].' ORDER BY t.name ASC';

 $children = $wpdb->get_results($sql);
  
  if(!empty($children)){
  
  $str ='<div class="our-beer-child-cat-list-container">';
  foreach($children as $k=>$v):
  	$str .= '<div class="our-beer-child-cat-list"><i class="fas fa-caret-right"></i>';
    $term_link = get_term_link( $v );
 	$str .= '<a href="' . esc_url( $term_link ) . '">' . $v->name . '</a>';
    $str .= '('.$v->count.')';
   $str .= '</div>';
    
  endforeach;
  $str .= '</div>';
  } else {
    
    $str ='<div class="our-beer-child-none-found text-center">
		Daaaaannnggg!<br>No subcategories of this beer type have been made. <br>Click on the main beer type above.</div>';
  
    
  }
  return $str;
  
}
add_shortcode("show_nested_views", "func_display_view_output");

Then within your parent view's content template, I've adjusted the output as given under:
=> hidden link

<div class="our-beer-parent-cat-list">[wpv-taxonomy-link]</div>
[wpv-conditional if="( [wpv-post-id] ne '2397' )"]
   	[wpv-view name="beer-types-belongs-parent" cached="off"]
[/wpv-conditional]
[wpv-conditional if="( [wpv-post-id] eq '2397' )"]
    [show_nested_views ptid='[wpv-taxonomy-id]']
[/wpv-conditional] 

As you can see we are checking the "Our Beer" page ID and if we are on the "Our Beer" page it will run the following shortcode to render the child terms:

[show_nested_views ptid='[wpv-taxonomy-id]']

And if are NOT on "Our Beer" page, it will run the normal child view to render the child terms which used to be working using child view as before.

[wpv-view name="beer-types-belongs-parent" cached="off"]
#2260141

Thanks Minesh!

Seems to be working. I have had this issue before. I know its occurrence is rare, but it would be great to find a more permanent solution using TOOLSET. I was pulling my hair out 🙂

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.