I solved it with fetch, pure javascript. I followed this article to do it, hope it will be useful for many:
https://templateartist.com/2020/05/26/javascript-fetch-api-to-load-wordpress-posts/
Related Posts:
- wordpress post loop in javascript
- angularjs not displaying all posts
- Using Javascript for Looped Content
- Can’t access PHP array inside script localization from javascript
- Add File Attachment Name and URL into Javascript
- Using jQuery .after inside loop
- Creating a User-Adjustable chart in WordPress
- How to avoid appending “null” in Ajax?
- How to manually define the primary loop
- How to fix pagination for custom loops?
- Why should I put if(have_posts()), is while(have_posts()) not enough?
- AJAX with loop filtering categories
- Remove the Homepage Query
- A search for ‘0’ returns results
- Custom Loop and Infinite Scroll
- Loop that displays PARENT PAGE & CHILD PAGE & outputs GRANDCHILD PAGE title and content
- wp-admin redirecting to https, denying login
- Three different post types on homepage
- Add Incrementing ID to each paragraph in the_content
- Multiple posts with one loop iteration
- Query date in wordpress loop
- Custom Loop, Match Category with Page
- get_the_content not working in loop?
- Get link of inserted media file of post within loop
- If No Search Results, Show Posts from Alternate Search Query
- Loop – how to get previous/next post for first/last post?
- Output shows a page instead of a list of blog postings
- How to add “time” data this?
- multiple loops with pagination on the same page
- Custom search form to display users only
- Multiple loops on the same page removing post tags
- Pages inside a page (with thumbnails)
- How to make post content from each post display within the same div
- How to order posts by meta_value created inside loop?
- How to get_posts where ‘menu_order’ is more than 0/zero?
- WordPress Redirects on Install
- Problems with loop
- Repeating Loop on my Posts Page
- Combining action and filter?
- Calling & display certain product category loop and pagination on the homepage
- Display Authors in a grid loop
- Infinite Scroll and DFP
- Blog’s post count cause irratic behavior
- show random image in loop if image is not set
- Get Page content to displayin Bootstrap Modal
- Pagination – works on local but not live dev!
- Does WordPress Loop have a function like Shopify’s cycle?
- How to show more random posts if Tag has less than 3 posts
- How to display pending posts on the homepage only for editors
- Add leading zero to current post display [closed]
- Distribute Gallery Images Every nth in Loop
- WordPress Image Slider Looping Title Not Working
- Output meta into arrays
- Is there any good reason for two CSS files to @import each other?
- Adding div after every two post on main loop! Why will first post not get counted?
- Moving wordpress to different url/server creates redirect loop
- Second Loop Showing Only One Post on Single Post Page
- Random post link generator messes up the loop
- how can i order the category by date
- Change position of entry title
- excerpt not showing up
- Pagination for two loops
- Announces with different formatting dependently on a number
- Using the loop to set locations for all posts on a single google map
- Override orderby to create list of users by custom meta_value
- Thumbnail Image Rounded Corners w CSS (or any other good method)
- Several loops in sidebar issues
- List page is showing 404
- Adding $args to wp_schedule_event() causes hook to add infinitely to WP Cron
- $post is undefined in wordpress loop [ajax]
- Duplicated tag in loop
- Loop only shows first two posts
- Why is my archive page looping through all but one post?
- Loop two different category WP_Query
- Use ACF Category Image for all Taxonomy Archive Views
- Loop with custom posts, to include information from different custom post type
- My WordPress installation doesn’t load correct template
- Work arounds for conditional checks inside the loop in search.php?
- Transient not working for external data
- adding tax_query to $query_string
- Popular posts with Varnish ESI
- Querying posts from only one category and exluding the latest post
- Remove posts_orderby filter then add it back in
- the_title() Returns the page title instead of the post
- WP update_post_meta link loop
- How do I aproach this?(for sale, for lease, sold->move something from a category to another)
- How to fix pagination for custom loops?
- Conditional Check in The Loop’s Parameters
- How does the JSON API work to parse incoming JSON and fetch a post based on an ID?
- How to add excerpt in loop in Twenty Eleven theme?
- show posts from one category with comments only
- Exclude Authors based off date of last post
- How to implement template file and the loop
- Show only posts from todays date [duplicate]
- I need to update the post query? [closed]
- Wrap every 2 divs in row – for each loop [closed]
- repeating posts on 2nd page to posts
- Limitless amount of posts in custom archive page
- Two loops in CPT archive page, exclude posts from main query
- Hook in the loop after the first post