Skip Navigation

[Resolved] Setting up taxonomy to show on default archive page

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 11 replies, has 2 voices.

Last updated by Elsie 1 year, 7 months ago.

Assisted by: Minesh.

Author
Posts
#2597847

Tell us what you are trying to do?

The default archive page for the taxonomy in question is /county/name-of-county/. I'm trying to make a view that will show whatever county is in the URL as shown. But I can't seem to set the right filter or whatever in the view. I want to be able to show all bicycle trails from that county in one view. Then another view that shows all business in that county. So two views that I will show as shortcodes on that archive page.

Is there any documentation that you are following? I did an extensive search of the support section and did not find the same issue.

Is there a similar example that we can see?

What is the link to your site? hidden link (What's currently shown on the bottom of this page is the default format from the theme for showing a post. I need to be able to set what shows there.)

#2598399

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Can you please share admin access details and let me see what views you created and what filters you added to your views.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) 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.

#2599063

Minesh
Supporter

Languages: English (English )

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

Have you created the view to display the related trails belongs to the current taxonomy archive?

#2599285

I created one of them and then was going to duplicate to create the other. The one I created is Trails by County. I'm trying to get it to show the Bike Trails by County when viewed on the default county taxonomy page. So, on /county/alachua, it would show the trails in Alachua County. Then I was going to duplicate that to create a view that shows the Businesses by County.

But I cannot figure out how to set up the view to show whatever county is represented on the page.

#2599467

Minesh
Supporter

Languages: English (English )

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

First of all, I see on your plugins page that you are using outdated Toolset plugins. We always recommend running your site with the latest stable release plugin version.

*** Please make a FULL BACKUP of your database and website.***

Could you please update ALL Toolset plugins to it's latest officially released version. You can download the latest plugin release from your accounts page:
=> https://toolset.com/account/downloads/
OR
You can install/update Toolset pluigins using the installer plugin:
-https://toolset.com/faq/how-to-install-and-register-toolset/#automatic-installation-once-you-have-otgs-installer-plugin-installed

I'm not sure why you want to create a view or taxonomy archive file as you can create taxonomy archive using Toolset.

I see you already created the taxonomy archive for the country taxonomy:
- hidden link

#2599685

Do I not get notifications anymore when these plugins need updating? None of them say they need updating. That's new. How convenient. I guess I need to go check every client website that uses Toolset. I've update them, but that really has nothing to do with my issue.

Right, I'm asking for your advice. I'm not saying I've done it the best way.

Unfortunately, those archives were made using Blocks, and I'm no longer using Blocks. This website is not built in Gutenburg. Also, the archive building feature of Toolset does not seem to be working correctly on my installation. When I "Add" one, it just brings up a blank page like I'm creating a post. And when I create a new one, it says it's in Block even though it's not.

#2599943

Minesh
Supporter

Languages: English (English )

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

If you do not want to use block editor then you can switch to classic editor for the archive from:
=> Toolset => Settings => General tab => Editor to use for WordPress Archives and we set the "classic editor" option there

Now, when you try to create new archive it will create archive in classic mode:
- hidden link

I suggest you should just backup your theme files and create the archive using classic editor.

More info:
- https://toolset.com/documentation/legacy-features/views-plugin/creating-wordpress-custom-post-archives/

#2600183

Thank you SO MUCH! I'm so glad to be able to make archives! The one thing I can't figure out is how to list both post types with a title at the beginning of each. I can put a title at the beginning of the first one in the loop, but not the other one. I formatted each post type differently, but how do I get the second heading in? I sorted them by post type, so all the trails will show up first. Then the businesses.

[wpv-conditional if="( $(wpcf-address-business) eq '' )"]
[wpv-post-link]
[wpv-post-featured-image]
[wpv-post-read-more][/wpv-conditional]
SHOULD BE A HEADING HERE
[wpv-conditional if="( $(wpcf-address-business) ne '' )"]<p><b>[wpv-post-title]</b><br />[types field='address-business' output='raw'][/types]
<br />[types field="business-phone-number"][/types]</p>[/wpv-conditional]

#2600225

Minesh
Supporter

Languages: English (English )

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

Currently all the posts belongs to the business post type. Can you please setup few post for bike trails and then let me check what we can do here.

#2600243

Here's one that has both: hidden link

#2600617

Minesh
Supporter

Languages: English (English )

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

Can you please check now: hidden link

I've added the following code:
=> hidden link

[wpv-conditional if="( '[wpv-post-type]' eq 'business' )"]
			   [heading condition="ptype" value="[wpv-post-type]"]
<h4><p><b>Business Trails</b></p></h4>
[/heading]
[/wpv-conditional]

And added the following code to "Custom Code" section offered by Toolset:
=> hidden link

add_shortcode('heading', 'func_set_heading_for_posttype');
  
function func_set_heading_for_posttype($atts, $content = '') {
  static $ptype = null;
  static $month = null;
  $condition = $atts['condition'];;
  $value = $atts['value'];;
  switch ($condition) {
    case 'ptype':
       if ($$condition != $value) {
        $$condition = $value;
        return $content;
      }
      break;
  }
  return '';
}

More info:
- https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/
- https://toolset.com/2013/10/how-to-group-views-results-by-year-and-month/

#2600769

My issue is resolved now. Thank you!