That answer I’ve linked to shows the steps you’ll need to take. It probably didn’t come up in your searches as you weren’t using the right terms.
As you’re a front-end dev, this is how I’d do it based on that persons advice.
- Don’t load anything in the template. Just have an empty ul with an id you can target, and a button to use for the click event.
- Create a php function, in functions.php, with one parameter (current_list_num) to get 6 posts using get_posts. Use the “offset” parameter to define which 6 to get (current_list_num / 6).
- Have the button, wherever it is, trigger the ajax call. As part of the ajax, pass in the number of items in the list currently. That will give you the offset needed for the get_posts call.
- On page load, trigger a click of the button to start the process
Related Posts:
- Allow only new sub-pages to be created
- Check if is on child-page of a particular page
- A check for if is parent page, if has children, if has grandchildren
- Can I have two child pages of different parents with the same name?
- Create a “Dummy” parent page for a hierarchy in page listing?
- Is there a default template file for child pages / subpages?
- Get Permalink for the top level parent of child pages
- Some pages are missing from the Parent Page select in the Editor
- How to display list of child pages of parent page in wordpress?
- Only allow new subpages to be created
- Can’t change parent page
- Call the content of a page in AJAX in WordPress
- Show child pages when on a child page
- select a private page as parent for another private page
- WordPress pages with hierarchy
- load common thank you template with different content for different pages
- How get get list of pages in ajax search
- remove/hide pages from users backend
- List child pages by slug not ID?
- Can’t get done anything with admin.php response
- get_pages() & “child_of”
- Combining ‘depth’ with ‘include’ in wp_list_pages()
- Removing Parent Page URL While Keeping the Navigation Intact
- Loading Multiple Comments Pages via Ajax?
- Organizing Your Pages
- Custom page template for multiple pages
- Can a user find a child page?
- Display child pages in sidebar of parent page in wordpress
- Display child pages in a parent page? [closed]
- Redirect page to default subpage
- How to list a page tree?
- List all posts with the parent or grandparent of a page with a specified ID
- Page access only from a specific page in wordpress website
- How To Render Shortcode In AJAX Response?
- Keep page hierarchy in wp_list_pages, even if on a child or grandchild
- Listing all child-pages of a parent-page on the parent-page and each child-page?
- How to control display of page lists on sidebar that doesn’t have childrens
- Check if page has subpages
- Exclude child pages args array
- Search anything from a Child and Sub-Pages of their Parent page
- How to get an array of pages ID by some page’s slug and all its children pages in get_posts() function?
- Return true if parent page id matches
- If page or sub page not working as expected
- How to use wp_dropdown_pages or wp_list_pages to accomplish a menu like this?
- Display grandchild page content on parent page
- My AJAX requests take 30 seconds to complete
- Display inner pages like posts.[Like how post excerpt works]
- How to show the view more on my display of pages shortcode
- Childpage title + content on Parent Page
- How to copy specific page content and create child page?
- Pages redirecting to homepage
- Firing page_publish where page is child page
- How to finish this loop?
- displaying child pages in columns when on a parent page
- How to make in post Parent page children page list nummbered
- Woocommerce – Making product pages child of shop
- Passing form data via AJAX to REST API And displaying results
- Slug of a child page is accessible with and without the parent slug in the URL
- Add infinite scroll to content splitted post
- Check if wp-login is current page
- How to view front-end of WordPress website, using Atom?
- page title showing twice [closed]
- How to get a list of pages (not posts) with specific tags?
- I reached halfway through a WordPress tutorial to find out I began wrong for a new comer to WP
- Fresh WordPress installation not able to simply show page content
- Can’t create new pages in wordpress
- Custom template is not showing up in templates dropdown list after re-naming it
- How to add page category slug to base url
- how to add a .accdb file to your wordpress website
- Why is a page shown with ‘hidden’ next to the name in the list of pages if the page is set to public?
- How to change the default location where new post gets stored?
- May I know where to edit the tax rate?
- Need pages with same names in multiple subdirectories
- Why does updating the front page give a 403, but no other page?
- Website content shifted all the way to the left
- Live page errors should be hidden
- Search page doesn’t recognise post_type=page
- Best approach to create a customized page
- How to make a secondary Pages Screen
- Dynamic activation page in WordPress
- How to force a page to load and have a particular dynamic tab as active
- Very strange problem with occasional 404 errors
- Remove element from admin page editing part
- Subpage for Custom Post Type
- Site Library issue
- Change meta information for link to page
- All content of one page shifted to the left
- Landing Pages and Pop Up Overlay
- how to update page without reloading the page builder?
- Restrict page to members only does not work for page ID, slug or page title
- Why Does get_page_by_path Return The Sample Post?
- Added .lowercase-alpha-list now my list is adding an extra period
- Search Result to Link to a Specific Page
- How do you add a filter to wp-block-page-list?
- Adding a Admin Style Table in a WordPress 4.x Page
- Create a PAGE using wordpress API using the PAGE template and change specific content
- No full page reload when navigating from page A to page B: is this possible with WordPress?
- Change the color of one or more specific items on the Pages list (Admin)
- How to use a common header and footer in the ‘Custom HTML’ block across pages in WordPress?
- Page does not load after clicking link. Only after manually refreshing page?