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
- Get page id by template
- How to load JS and CSS only on specific Pages using is_page()?
- Listing pages which uses specific template [duplicate]
- WordPress page edit does not save selected template
- Automatically set page order on create page
- WP is not using the select custom template.php that its selected for a page
- Is it possible to set a page template on a dynamic home page (articles list)?
- wordpress with many custom styled static pages
- Check whether the child page has siblings
- wp_dropdown_pages default value
- A function like is_page() but returns true if on any sub page of given page
- Get all children page ID’s including parent by title
- How to modify the default WordPress ‘Pages’ widget to have titles on the anchor tags?
- is_home() returns TRUE on page template
- Adding New Users to Your WordPress Site for edditign only one page
- IF user is logged in only show certain page
- hard coded html / php pages on local host directory don’t show up in WP dashboard
- the_content of template page
- Post Fetching Ignoring Sort_Column?
- How to show ‘tags’ in ‘WordPress Pages’ [not Posts]
- determine whether content is of type Page or a Post and display accordingly
- Automatically generate pages from SQL
- require_once not working
- is_single(); Question
- Showing Different Code on Pages With Different Layouts
- How to make title for home to be News, but if page has parent then its name else just post/page name
- Get all pages to display at once
- Show specific page on main index instead of latest
- Add Filter to Ignore a Post/Page or a Number of Post/Pages
- I want to create a Weebly site and have it show up as static pages on a WordPress site
- How to use the full page
- anchor tag in header not working on other pages except the home page
- How to make transition slider load before home page
- Odd twitter meta data description on all pages
- Include parent page in list of child pages
- How to sorted Parent Page in WP-admin
- How to see the dashboard of a downloaded wordpress website?
- Remove and change pages label
- How can I get the page from menu as posts?
- Setting Default Screen Options
- one time visit to the page
- How to display text of a page in home or custom page?