I have a Custom Post Type (CPT) named "Events", and I want to add a Query Loop on my front page that displays the upcoming events that my website visitors may want to participate in. On the "Post Type" setting of the Query Loop, I only saw two choices: "Post" and "Page". However, I heard Query Loop can be used with CPT too and I saw a YouTube video showing a Query Loop with CPT options (screenshot below).
The video itself does not cover how to apply CPT on Query Loop, so I tried googling for some tutorials. I found this article which may contain the solution I need; the thing is it requires NodeJS which I am not familiar of.
So I wonder if there is any alternative solution to this. Perhaps PHP code that does not require NodeJS? Or a certain plugin that I can install? Thank you in advance!
I have a Custom Post Type (CPT) named "Events", and I want to add a Query Loop on my front page that displays the upcoming events that my website visitors may want to participate in. On the "Post Type" setting of the Query Loop, I only saw two choices: "Post" and "Page". However, I heard Query Loop can be used with CPT too and I saw a YouTube video showing a Query Loop with CPT options (screenshot below).
The video itself does not cover how to apply CPT on Query Loop, so I tried googling for some tutorials. I found this article which may contain the solution I need; the thing is it requires NodeJS which I am not familiar of.
So I wonder if there is any alternative solution to this. Perhaps PHP code that does not require NodeJS? Or a certain plugin that I can install? Thank you in advance!
The post-type dropdown in the Query Loop block is populated with data from the REST API endpoint:
/wp-json/wp/v2/types
so we have to make sure the public custom post type is registered with show_in_rest
as true
for it to be included within that data.