Table of Contents
Dynamically generated anchor links for Ajax loaded content
In this example:
Ajax Load More will dynamically create a table of contents for each page loaded via Ajax.
Clicking a table of contents anchor link will scroll the user to the top of that specific page within the Ajax Load More listing.
Enable the Table of Contents component by adding the following HTML element to a WordPress template or page.
1 |
<div class="alm-toc"></div> <!-- Renders: [1][2][3] etc... --> |
Note: The Table of Contents component is support by the SEO, Filters and Single Posts add-ons.
Sections:
-
Ajax Load More 7.0
Refactoring Ajax Load More for the future.
-
Tracking Pageviews with Google Analytics 4
Measuring page views automatically with GA4 and Ajax Load More.
The following shortcode was used to create the Table of Contents example.
[ajax_load_more preloaded="true" preloaded_amount="2" posts_per_page="2" pause="true" scroll="false"]