response.json())
.then(data => {
currentTags = [];
stickyPosts = data;
})"
@get-posts="fetch('/wp-json/wp/v2/posts?per_page=6&exclude=' + stickyPosts.map(post => post.id).toString() + (currentCategory ? '&categories=' + currentCategory : '') + (currentTags.length ? '&tags=' + currentTags.toString() : ''))
.then(response => {
totalPosts = parseInt(response.headers.get('X-WP-Total'));
return response.json();
})
.then(data => {
posts = data;
currentPage = 1;
pageLoaded = true;
})"
x-init="
$watch('currentCategory', () => $dispatch('get-sticky-posts'));
$watch('stickyPosts', () => $dispatch('get-posts'));
$watch('currentTags', () => $dispatch('get-posts'));
"
>
No posts found in your selection!