Hello Friends,
I need add per page parameter set in particular page for custom post type api data.
please help me.
Thanks
Hello Friends,
I need add per page parameter set in particular page for custom post type api data.
please help me.
Thanks
You can add the params
property to the @frontity/wp-source
configuration and set the per_page
property, and a property for the type
of CPT that it should be applied to. Note that you also need to have set the postTypes
property with the same type
name.
{
name: "@frontity/wp-source",
state: {
source: {
url: "https://your-site.com",
postTypes: [
{
type: "your-cpt-name", // this needs to match an item in the params.type array
endpoint: "your-cpt-slug",
archive: "/your-cpt-archive",
},
],
params: {
per_page: 5,
type: ["your-cpt-name"] // this needs to include the same name used in the postTypes.type property
}
},
},
}