Support » Plugin: Category to Pages WUD » How to make categories and tags appear in acf-to-rest-api ?

  • Resolved yeb215

    (@yeb215)


    Hello !

    How to make categories and tags appear in acf-to-rest-api’s JSON ?

    I have configured the WUD plugin, set categories, and choosen the categories in the page edit, but it doesn’t appears in the JSON rendered by wp-to-rest-api. What should I do ? Is there is something to include in the functions.php ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Danny WUD

    (@wistudatbe)

    Hi @yeb215,
    Are you using a plugin for the rest-api?
    Can you give me some more detailed info, so i can reproduce this?
    Regards, Danny

    Hi Danny,

    Sorry, my bad. Weren’t fully awake when I wrote that.
    The problem is as follow :

    – Create a page.
    – Access the page’s data using the REST API browsing to /wp/wp-json/v2/pages
    – Install your plugin,
    – configure exclusive categories,
    – create a category and assign to the page
    – browse again to /wp/wp-json/v2/pages and see that theere is no “category” field.

    I’ve added this to functions.php and it works.

    `
    // Add the page categories to REST API
    $mytax = get_taxonomy( ‘categories’ );
    $mytax->show_in_rest = true;
    `

    Plugin Author Danny WUD

    (@wistudatbe)

    Hi @yeb215,
    Thanks for sharing the solution!.
    I will investigate this and hope that i can give you a permanent solution.
    Regards, Danny

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.