wp-ajax-feed

Example Usage

Usage no npm install needed!

<script type="module">
  import wpAjaxFeed from 'https://cdn.skypack.dev/wp-ajax-feed';
</script>

README

Ajax Feed Javascript Package

Example Usage

let portfolioFeed = new AjaxFeed({
    'baseUrl': site_info.ajax_url,
    'action': 'portfolio_feed',
    'container': $('.portfolio-feed'),
    'filterForms': $('.portfolio-feed-filters'),
    'paginationContainer':$('.portfolio-feed-pagination'),
    'paginationDataAttribute': 'data-ajax-page',
    'submitOnFilterUpdate': false,
});

Example Server Response

let response = {
    'html': 'HTML Response that will populate the container',
    'pagination': 'HTML response that will populate the pagination container',
    'currentPage': 'the current page',
    'maxPages': 'the total amount of pages in the current query'
    'posts':'The raw post data that was returned by the query'
};

Settings

Methods

Events