unique1233
Forum Replies Created
-
Forum: Plugins
In reply to: [Custom Post Type UI] Custom Post Type Archive Link MenuI am using the WP REST API MENUS plugin to expose the menu data via the API.
For example: https://dev.some-url.test/wp-json/wp-api-menus/v2/menus/2
The 2 at the end represent the id of the menu. In this case 2 = primary menu.
I am not sure if I need to set up anything else in the settings in order for this to work. Everything seems legit.
Forum: Plugins
In reply to: [Custom Post Type UI] Custom Post Type Archive Link MenuFrom the WordPress admin panel, I go to Appearance -> Menus -> On the left side of the screen my custom posts called Services appears and I have an option to check Services archive and add it as a link to primary menu.
I am using Frontity on the front-end, so all of my wp content is being exposed via the API.
After saving the menu, when visiting wp-json, this is what the link looks like:
{
“id”: 83,
“order”: 3,
“parent”: 0,
“title”: “Services”,
“url”: “https://dev.some-url.test/services/”,
“attr”: “”,
“target”: “”,
“classes”: “”,
“xfn”: “”,
“description”: “”,
“object_id”: 12,
“object”: “services”,
“object_slug”: null,
“type”: “post_type_archive”,
“type_label”: “Архива врсте чланака”
}As you can see, the slug is null, therefore on the front-end side of the project, I cannot use the link as I should.
The slug should be /services as this is the path to the services (custom post type) archive. Not sure why am I getting the null as a value to the link.
Hope this helps.
- This reply was modified 3 years, 10 months ago by unique1233.
- This reply was modified 3 years, 10 months ago by unique1233.