I have created the custom post in function.php file, it is working fine for me. When I call custom post data via WordPress REST API, It is showing me the error on browser.
Below is the error which was showing me in the browser.
code "rest_no_route"
message "No route was found matching the URL and request method"
data
status 404
But rest API is working for default post which is present in WordPress.
For custom post we need to allow the Rest API below is the code
'show_in_rest' => true,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With