Skip Navigation

[Gelöst] View on Custom Taxonomy Archive Page w/Infinite Scroll Only Shows First Page FIX

This support ticket is created vor 7 Jahre, 11 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 1 Antwort, has 2 Stimmen.

Last updated by Minesh vor 7 Jahre, 11 Monate.

Assisted by: Minesh.

Author
Artikel
#397325

Hey, so I came across this problem earlier today and I solved it pretty easily, but saw that some threads had similar problems with no answer, so I thought I would share mine here to help others / maybe get a fix if there is something broken:

The problem: I use a custom layout for my custom post taxonomy "listing-categories". Tried to first use an archive view for this taxonomy, but it does not give the option of using infinite scrolling.

Then, I decided to create a view that has a filter: taxonomy "set by the current archive page". It was querying the right posts, BUT infinite scroll only loaded the first page. When I scrolled down, it reloaded and said "no items found".

THE FIX:
I fixed this problem by using the taxonomy filter: listing-categories are set by one view shortcode, and then the name of the taxonomy, listing-category-name equals the shortcode, wpvlistingcategory

But we're not done yet. I had to find a shortcode to output the name of the taxonomy on the archive page I am on. I didn't see a views output that could display that, so I searched the forums and found a custom function that could do that:

add_shortcode('wpv_show_curent_tax', 'wpv_show_curent_tax');
function wpv_show_curent_tax() {
  if( is_tax() ) {
    global $wp_query;
    $term = $wp_query->get_queried_object();
    return $term->name;
  }
}

This shortcode, [wpv_show_current_tax] (make sure you add it into the 3rd party shortcodes in Toolset-Settings-Front End Content first) can be placed inside of my views argument to dynamically output the name of the taxonomy which the user is on, only showing those posts. Here is the view which is displayed on the layout used for my product-categories archives:

[wpv-view name="listings-categories" wpvlistingcategory="[wpv_show_curent_tax]" view_display="layout"]

Now my infinite scroll loads more than the first page and I am happy.

In theory, the query filter: taxonomy "set by the current archive page" should do the same thing, but for some reason it wasn't. Is there any explanation for that?

#397638

Minesh
Supporter

Languages: Englisch (English )

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

Hello. Thank you for contacting the Toolset support.

Basically, pagination is not supported with the archives.

But we are planning to add this feature in near future. You can see it will be implemented with views release in near future. I do not have any ETA.

However, Thank you for sharing fix, this may help other users.

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