• Resolved wpusr007

    (@wpusr007)


    INITIALLY POSTED HERE ON THE MAIN FORUM BUT MOVED HERE SO PODS DEVS CAN SEE

    Hello, first post here and new with WP. I have built a small website accessible only on my home network to replace a Drupal website that I used to catalog a collection of music records and books.

    I must say, with WP and Pods, things are a lot easier and more powerful!

    I created 2 pods named “Books” and “MusicRecords” and created templates for each of them along with each their own pages to display the “entries” on the main site. Everything works fine so far (minus some things I will need to address later on…), but the issue I am facing is that the system doesn’t auto-generate a Unique identifier for each entry.

    With Drupal, each time I created a new entry in one of the taxonomies (content types in Drupal verbiage), the system would automatically generate a unique number called NodeID which was auto computed and unique to each entry.

    I would like to achieve the same in WP so I can tag each of the physical pieces with a unique number. Doesn’t matter what format it is, numeric, alpha-numeric, etc… As long as I can print a sticker with the UID on it. Fairly simple IMO but I cant find how to do this in WP. AFAIK, Drupal came out of the box with this.

    Can this be done? I think what makes things a bit complicated is that I am using Pods to catalog my collections and not using standard web coding/static pages (excuse my crude understanding)…

    I looked around on the web, and in Pods fields, none seems to offer anything similar. I could just add a text field and manually enter a UID in it, but that defeats the purpose of the UID.

    I also tried to install the plugin “Print Barcode Labels for your WooCommerce products/orders” but I cannot make it work with pods (I dont think it was made to work with Pods…)

    In a perfect world, the system would generate a UID, and I could print it from WP. Is this possible? Am I dreaming?

    Looking forward to some replies! Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Paul Clark

    (@pdclark)

    You can use the post ID or get_permalink() for this.

    If you’d like to generate a unique short ID for each item, you may be interested in https://github.com/ssnepenthe/wp-hashids

    If you’d like a QR code for each item, you may be interested in https://www.ads-software.com/plugins/kaya-qr-code-generator/

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @wpusr007

    WordPress also generates a unique ID for each entity.
    In WordPress the closest thing to a Node is a Post. All post types are stored in the same table and each with have a unique ID: the Post ID.

    You can access posts from their permalink URL or by using the p param: your.domain.com/?p=123 which will automatically redirect you to the permalink of Post ID 123.

    Hope this helps!

    Cheers, Jory

    Thread Starter wpusr007

    (@wpusr007)

    Thanks guys for replying!

    I installed the “Kaya QR code” plugin, and its very easy to use, it generates a unique QR code for each Pods entry by inserting:

    [kaya_qrcode title_align="alignnone" ecclevel="L" align="alignnone"]

    in the Pods template.

    However, the permalinks dont seem to be using Post ID’s. For example, the page I created to “catalog” my books has the following permalink

    https://localserver/wordpress/?page_id=157

    while an entry (for example Sapiens) has

    https://localserver/wordpress/?book=sapiens-a-brief-history-of-humankind

    The URL seems to use the post title and not the Post ID…. Am I doing something wrong with the way I create entries (posts)?

    Plugin Support Paul Clark

    (@pdclark)

    Install and activate Custom Post Type Permalinks: https://www.ads-software.com/plugins/custom-post-type-permalinks/

    Go to Settings > Permalinks, then set the permalink structure for your CPT to /%post_id%

    Thread Starter wpusr007

    (@wpusr007)

    @pdclark : Good recommendation for the CPT permalink plugin. Now each entry has its own post ID number and I can use the {@ID} in the Pods template to retrieve the post ID and use it in the text or page contents for easy identification.

    I have some other questions regarding Pods but since this topic is closed I will open up a new thread.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Generate pods unique identifier for each entry’ is closed to new replies.