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
- Get the content of a specific page (by ID)
- How to give paged links custom title?
- Show Default Editor on Blog Page ( Administration Panel )
- Create pages automatically if they don’t exist
- How to redirect on particular page in wordpress? [closed]
- Internal Links to Pages in PHP?
- Display subpages under parent page as a list within a loop
- Restrict acceess of a page in backend
- The entire content of my WordPress page has disappeared
- What is the proper way to get contents of a page?
- Can I include Javascript/jQuery in a page?
- conditional tags- how to use with shortcodes
- List all private pages user has access rights to read
- How to update the counter of private pages in the dashboard?
- Trying to return list of child pages for a template
- Any Ideas for Including “More Tag” with get_pages($args)?
- Using in-build Visual Composer param types in custom param types
- Google Analytics tracking code on just one page?
- Hide page templates without using ‘unset’
- page.php is not called, falls back to index.php
- Custom page in archive page for certain category
- Is it possible to check for shortcodes on a page?
- Use same page-mypage.php template for several pages
- How do you implement a page template automatically being applied to a page?
- Is it possible to restrict access to specific pages in the admin area based on the page slug?
- Make “default” wordpress pages & features unaccessible
- Set a variable to using in redirected page
- How can I edit pages from my local environment?
- Why can’t pages be categorized / tagged?
- Adding in additional pages into a custom theme
- List of pages of a specific user
- Multiple meta_key with get_pages
- Sup pages can’t be found
- Get child pages in get_pages function
- Bundle a page with custom url and a function
- Custom Upload Adds Ghost File
- Widget & storing a Select box choice
- How to Change the path of a child page?
- Annoying notification when trying to create a new page
- disable trashability for certain pages
- pages won’t show on front page using loop or pre_get_posts
- Custom wp_list_pages() function