Hi, following this https://toolset.com/forums/topic/create-load-more-button-with-toolset-blocks/ I'm trying to load multiple articles in the same page but my button opens second page when I click it even though I have infinite scroll set up.
I'm sending you my screenshots of the settings.
To block auto infinite scroll I used this code and it works.
(function ($) {
$(document).ready(function () {
$('.js-wpv-layout-infinite-scrolling').removeClass('js-wpv-layout-infinite-scrolling');
});
})(jQuery);
I have a test site here hidden link. As you can see the button opens a second page while I have to load the second page below the first.
How can I solve this problem?
Thanks for your help.
Hi there,
Would you please remove the Pagination block and instead, use the shortcode block and add the shortcode below?
[wpv-pager-next-page force="true"][wpml-string context="wpv-views"]Load More Button here ...[/wpml-string][/wpv-pager-next-page]
If the issue persists, I'd appreciate it if you could give me the URL/User/Pass of your WordPress dashboard after you make sure that you have a backup of your website.
It is absolutely important that you give us a guarantee that you have a backup so if something happens you will have a point of restore.
Make sure you set the next reply as private.
Hi there,
I checked the website but the information you gave is not the website that you have the link to:
hidden link
Please give me login information for that to be able to check.
Also please make sure you have a backup of the website as I might need to turn off /on plugin or the theme for a possible conflict.
Thanks.
Hi there,
I am not sure how you created your homepage. I tried to understand but it is so complicated.
Instead, I created a test page and implemented the Load More feature:
hidden link
One thing that you need to make sure you do is to add the Flield and Text block and add:
[wpv-pager-next-page force="true"][wpml-string context="wpv-views"]Load More Button here ...[/wpml-string][/wpv-pager-next-page]
And make sure you add the block inside the View Output block. You can click the top burger menu and drag the block to the correct place.
Please check the screenshot.
Thanks.
Hi Christopher,
the home page is created from the Toolset content template called Home.
I send you my structure. I followed your instructions but it doesn't work.
Also in your example the button is still visible even when you load all posts, while I need to hide it on the last page.
Could you please help me by checking the problem in my model?
Thanks for your help.
Hi there,
I removed the force true attribute and now the load more button is removed when the pages are finished.
But the issue with your homepage is not fixed.
I added a pagination block and deactivated the view cache but the issue persists.
As the same thing works ok on the test page that I created I suggest that you do as follows:
- Go to Toolset > Content Template.
- Hover over the Home content template and click the DUPLICATE link.
- On the duplicated content template remove the other views that you used and keep only the view in question.
- See if it works then.
My guess is that either the other views have conflict and do not allow the workaround to work correctly or the containers but I am not sure and it needs you to be testing that.
If the issue is not that, then I will need to copy your website to our server so that we can investigate more.
Thanks.
Hi Christopher,
I did what you suggested.
You can see the new home page made with the Home-test content template, but it doesn't work even if I deleted all other views.
Can we add some code to solve the problem? Let me know.
Thank you.
Hi there,
I moved the website to our server to be able to do some investigation and I found out that the issue is the code that you added int he Fields and Text block inside the View output.
I removed that and instead used the Post Title with Link option and it worked ok:
hidden link
Please check within that code and see what is causing the issue there:
<div class="[wpv-post-taxonomy type='colore-pagina' format='slug']">
<p class="article-date">
<span class="argomenti"><b style="color: red;">[wpv-post-taxonomy type="argomento-principale" format="name"]</b>[wpv-view name="altritemi"]</span>
</p>
<h3>[wpv-post-title]</h3>
<span class="blocco-autore">[wpv-view name="nuovoelencoautori"]</span>
</div>
Thanks.
Hi Christopher,
Thank you. I noticed that the "newauthorslist" view is the problem. If I insert another view the page works fine.
But I need to have the author list of the main article and I find no other way to show them.
Could you suggest me another solution to do this?
If I put the author field it shows only the first author while I need the list. How can I do it? Thank you.
Hi there,
I am not sure what you have done in that view as we already deleted the copy of the website on our server.
What I suggest is that you create a new view with the authors and try to check with the Block Editor and not the classic view and see what happens.
Thanks.
Hi Cristopher,
I solved the view problem, now you can see it is working fine.
I have only a request.
I have a list of authors separated by coma and I need to hide the last coma of the list.
I added this code and it works fine on the first page:
(function toglicoma()
{
var spans = document.getElementsByClassName('blocco-autore');
var l = spans.length;
for (var i=0;i<l;i++) {
var ele = spans[i].getElementsByClassName('coma');
var lastEle = ele[ ele.length-1 ];
lastEle.parentNode.removeChild(lastEle);
}
return false;
})(jQuery);
But when I click on my load more button the function doesn't work on the second page.
How can I add the function to it?
Thank you so much.
Hi there,
Since the initial problem that prompted the creation of this ticket has been resolved, may I kindly request that you mark it as "resolved." I will then proceed to split the ticket in order to address the second issue.
By doing this, we can ensure that our tickets remain organized and that we have a clear summary of the issue at hand. This will enable other customers to access information more efficiently if needed.
Thank you for your cooperation and understanding.
My issue is resolved now. Thank you!