Support

Account

Home Forums ACF PRO Give aach post an increment number

Solving

Give aach post an increment number

  • Hi all,

    I’ve created a table like this one over here.

    It shows al downloads posted with WP Download manager in a table.
    Each download (row) is considered as a separate post in WordPress.
    I have added custom columns containing ACF values, which are specified during the creation of a download. Everything works fine, except of one important function; the numbering of each download.

    I need a column that say’s “Download #” and that gives each download (row) in the table an unique number. I’ve managed to do this by printing the POST ID in a column, those are always unique and never given out twice. This works quite well!

    The problem is that we already have hundreds of numbered downloads that will be imported to this table. Those excisting numbers may not change.
    After importing, the numbering need to continue or start where the import has ended.
    It is also important that a number is never given out twice, even after the deletion of a download.

    My question is, can I create a “Post ID” like numbering column using an ACF for exmple?
    The only problem I have with the current “Post ID” column, is that I can’t specify the numbers of the existing downloads by myself.

    Hope you guys can come up with something.
    Thanks in advance!

    Kind regards,
    Paul

  • I assume that when a post is ‘downloaded’ it gets inserted in the database. Can’t you use the row ID ?

  • Thank for replying Beee.

    You mean when a download is created, it get’s inserted in the database?

    That sounds like a possibility, but I wouldn’t know how to achieve that on the frontend of the table (by code).

    Would you?

    Thanks again.

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

The topic ‘Give aach post an increment number’ is closed to new replies.