Support

Account

Home Forums ACF PRO Adding A Custom Post Type to a Category Makes Advanced Custom Fields Disapear

Solving

Adding A Custom Post Type to a Category Makes Advanced Custom Fields Disapear

  • Hi All

    Basically what it says on the tin.

    When ever we try to add a custom post type to a WordPress category makes the advanced custom fields that we have created disappear from the page.

    There doesn’t seems to be much in previous bug reports and forum threads.

    We have already taken the following steps:

    1. Created custom taxonomies to create categories that way.
    2. Check for PHP errors.
    3. Check for JavaScript errors.
    4. Disable all plugins one at a time.
    5. Changed themes.
    6. Updated Advanced Custom Fields and WordPress.

    Can you help with this problem please?

    Thanks in advance.

    Kind regards
    Michael

  • Hi @michaelmatheson

    I’m afraid I don’t understand the issue. Could you please let me know the detailed steps to reproduce it? Also, could you please share the screenshots of the issue?

    Thanks 🙂

  • Hi James

    Sure no problem. Hopefully the steps listed will help.

    1. Create custom post types called ‘Products for sale’ and ‘Used Products For Sale’ through the functions.php file. (Screenshot 1) (Maximum of 5 attached files so I took out this one)

    2. Create categories for the 2 custom post types that they can be attached to called ‘Lawn & Garden’, ‘ATVs’, ‘Marine’ and ‘Agricultural’. (Screenshot 2)

    3. Using advanced custom fileds create fields that will be used when you add a ‘Product for sale’. (Screenshot 3)

    4. Add a new ‘Product for sale’ and fill out the details (Screenshot 4). When a new product has been added it looks like Screenshot 5 on the website which works just fine.

    5. Add your product to a category (where the problem occurs) (Screenshot 6).

    6. When this has been done the advanced custom fields from screenshot 4 disapear so that they cannot be edited again.

    7. The product still stays on the website but because the fields have disappeared the product cannot be edited until you uncheck it from being in a category. (obviously this isn’t ideal when we hand the site over to the users)

    As said before we have already tried:

    1. Created custom taxonomies to create categories that way.
    2. Check for PHP errors.
    3. Check for JavaScript errors.
    4. Disable all plugins one at a time.
    5. Changed themes.
    6. Updated Advanced Custom Fields and WordPress.

    I was going to attach the functions.php also file but max files reached.

    Thanks
    Michael

  • Extra post for Screenshot 1 and the functions.php file attachments.

    Thanks Michael

  • Hi @michaelmatheson

    The issue seems related to the location rules you have. Could you please share the JSON or XML export file of your field group so I can check your setup?

    Also, the forum doesn’t allow you to upload a PHP file. Could you please use https://gist.github.com/ instead?

    Thanks 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Adding A Custom Post Type to a Category Makes Advanced Custom Fields Disapear’ is closed to new replies.