Streaming live at 10am (PST)

Read more button increasing the limit of post displayed


#1

Hello, and sorry if this is answered before, but I havevn't found an answer to it.

So I have a news section (blog posts) that displays the latest 4 news articles, and underneath I have a button. So what I want is when the button is pressed, another 4 articles will be displayed, and clicked again another 4 is displayed. And so on. You get the idea.

I figured I have to add some JS-code, but I don't know how to target the items that's being limited, to increase the limit.


Here is my public share link: LINK
(how to access public share link)


#2

What we can do, is remove the limit. Then on page load with JS, hide all except the first four. All items will still be loaded, but we can control how many are displayed on a button click.


#3

Okey, and it's still gonna load X-amount of post per button click? Beacuse I don't want to show every post ever posted with one click.


#4

@samliew How would you recommend setting up the JS?
Do you have a code snippet we could have a look at? I think this is something that might help a lot of people out :slight_smile:

One concern I have though is that having them all load at one time might cause the side to be heavy to load.