Hi, I’m wondering if it’s possible to have a different per_page
parameter per post-type. Per example I want the blogs archive to show 10 posts at most, but the portfolio archive should show 20 posts.
This is my configuration in frontity.settings.js
:
...
"state": {
"source": {
"api": "https://frontity.noesteprojecten.nl/wp-json",
"homepage": "/web-app-development",
params: {
per_page: 20,
},
postTypes: [
{
type: "post",
endpoint: "posts",
archive: "/blogs",
},
{
type: "portfolio",
endpoint: "portfolio",
archive: "/portfolio-archive",
},
{
type: "wp_template_part",
endpoint: "template-parts",
},
]
},
}
...
How to configure this per post-type? I’d expect to be able to use the per_post
parameter per post-type, but it doesn’t work for me when I do it like this:
...
"state": {
"source": {
"api": "https://frontity.noesteprojecten.nl/wp-json",
"homepage": "/web-app-development",
params: {
per_page: 20,
},
postTypes: [
{
type: "post",
endpoint: "posts",
archive: "/blogs",
params: {
per_page: 10,
},
},
{
type: "portfolio",
endpoint: "portfolio",
archive: "/portfolio-archive",
},
{
type: "wp_template_part",
endpoint: "template-parts",
},
]
},
}
...