Home Forums ACF PRO Adding a custom field to a custom post type list page in admin Reply To: Adding a custom field to a custom post type list page in admin

  • OK, I know this is an older post, and I came about it while searching for a better solution to the one I have for a similar problem.
    As far as I’m concerned I also have a custom post type too and I want to ad user-editable information to the archive page (I guess that is what the OP meant by ‘list-page’.)

    It is quite simple to to one of two things:

    A) one makes a template archive-{cpt-slug}.php that does usual loop over the custom-post-type-posts and add information from acf-field from elsewhere ( options-page) and displays it before or after the standard loop.

    B) One builds a custom page template that has a custom-query loop restricted to the desired cpt and sets up a regular page that displays the acf content that is connected to said page-template.

    Both options are working rather well but both have their drawbacks. Option A keeps the usual WordPress mechanics intact but it is hard for editors to know where to edit the content as with archive-pages there is no WP-standard way of editing them and the wp-admin-bar lacks a link to edit the contents. Option B offers an edit Page link in the admin-bar but might break the wp-core mechanics, and looking for a page as the source of an archive is for expedierend wp-users counter-intuitive.

    It is indeed a WP-problem, that editor-editable content for archives including cpt-archives is not part of the system.

    Even categories have at least their description field and one could at (least in theory) add additional field at that intended location. (I’m rather certain I have done so in the past.) But with custom post types there is (to my best knowledge) no such logical place for editing such information.

    On can try to remedy the problems of option A or B with certain tricks like for option A
    Adding a custom link to the settings page in the admin-bar when the cpt-archive is displayed at the frontend and/or moving said settings page int a submenu oft the cpt-menu in the backend. Or with option B setting redirects to the page in htacces or using the cpt-slug as the page slug. But it doesn’t really solve the problem there is no native place in WorpPress for editable content on an archive page, or am I wrong?