• Resolved rcwdm

    (@rcwgsy)


    Is it possible to create a field that will display a number starting at 1 and rising indefinitely with every single new custom post that is created?

    1st custom post = 1
    2nd custom post = 2 and so on…

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @rcwgsy

    This is not a feature of Pods. We do support default values but these are fixed or set by GET parameters.
    However, if you are comfortable with PHP code you could create your own hooked function to create such an increment.

    What is the purpose of such a field? Maybe there is another solution I can think of.

    Cheers, Jory

    • This reply was modified 4 years, 8 months ago by Jory Hogeveen.
    Thread Starter rcwdm

    (@rcwgsy)

    Any pointers would be greatly appreciated.

    We are unable to find a way to sync our google sheets rows with various custom fields, we have tried zapier/automate etc and none recognise custom fields in posts at this stage.

    We found a workaround by adding a PHP function/API that allows us to pull in a specific google sheet cell with a shortcode. This means however we need a different shortcode for every single custom field entry.

    eg: [get_sheet_value location=”SheetName!A2″]

    To avoid the repetition of changing the cell number every time we create a new custom post, I’d like to find a way that the number would automatically increase each time we create a new post – so to ensure it always matches with the next Google Sheet row.

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @rcwgsy

    I’m no Zapier expert but the following page might help you (you can skip the first 3 steps as you’ve already done that). This tutorial is ACF based but it’s basically the same. You can enable REST support for all Pods fields.
    https://aball.co/news/create-a-custom-post-in-wordpress-using-zapier/

    However, if that shortcode works well you can use the WordPress core filters for metadata:
    https://codex.www.ads-software.com/Plugin_API/Filter_Reference/update_(meta_type)_metadata
    You could create a function with a switch for all fields that should be pulled from google sheets and set each meta value accordingly.

    Hope this helps!

    Cheers, Jory

    Thread Starter rcwdm

    (@rcwgsy)

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Auto increasing number field’ is closed to new replies.