Navigation überspringen

[Gelöst] Infinite Scrolling / Load more Button

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:

Q1) I build some dynamic CPT's and wanted to show them with Views and load more (inifinite scrolling), Is there another way to reveal the content only, if the user clicks the "Load more" button?

Q2) How does the code has to be modified to not show a custom field but the featured-post-image (standard field from wordpress)?

Solution:

A1) you can try to setup a higher number and test again, for example:

Infinite scrolling tolerance, in pixels: 9999

A2) You can replace the types image shortcode with Views featured image shortcode [wpv-post-featured-image].

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-featured-image

This support ticket is created vor 5 Jahren, 6 Monaten. 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von ThorstenS967 vor 5 Jahren, 6 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#1271105

Hi,

on my site I build some dynamic CPT's and wanted to show them with Views and load more (inifinite scrolling). I found the following thread:
https://toolset.com/forums/topic/load-more-button-3/
I tried Luo's solution (-500 for "Infinite scrolling tolerance, in pixels") and this works only partially. Some times it reveals the additional content after clicking the button, but often it automatically reveals the additional content. Is there another way to reveal the content only, if the user clicks the "Load more" button?
Also I want to show up some images from the featured-post-images as background URL in a CSS style. I found this thread:
https://toolset.com/forums/topic/image-field-which-is-set-as-background-is-not-looping-for-different-posts/
But I can't get it working. How does the code has to be modified to not show a custom field but the featured-post-image (standard field from wordpress)?

Thanks
Thorsten

#1271227

Hi,

Q1) Is there another way to reveal the content only, if the user clicks the "Load more" button?
There isn't such a built-in feature within Views plugin.
And that thread is only a workaround, you can try to setup a higher number and test again, for example:
Infinite scrolling tolerance, in pixels: 9999

Q2) How does the code has to be modified to not show a custom field but the featured-post-image (standard field from wordpress)?
You can replace the types image shortcode with Views featured image shortcode [wpv-post-featured-image], for example:

<div style="background-image:url('[wpv-post-featured-image size="full" output="url"]')"> ... </div>

More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-featured-image
-url option displays the URL of the image

#1271871

Thanks very much Luo, both work great. 🙂