Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Problem Saving Custom Post Type Meta Values

$article_date = $custom["tf_book_author"][0];
$article_date = $custom["tf_book_afirst"][0];
$article_date = $custom["tf_book_isbn"][0];
$article_date = $custom["tf_book_dts"][0];
$article_date = $custom["tf_book_price"][0];

This is your issue. You need to set these to $tf_book_author and such, especially if you’re going to echo them. I stopped there, so there may be more errors in the code, but that’s the first one to knock out.

Related Posts:

  1. Query all posts where a meta key does not exist
  2. Can the Next/Prev Post links be ordered by menu order or by a meta key?
  3. what is the correct way to compare dates in a WP query_posts meta_query
  4. Advanced search form with filters for custom taxonomies and custom fields
  5. Meta query with boolean true/false value
  6. Get post with multiple meta keys and value
  7. Correctly delete posts with meta and attachments [duplicate]
  8. Storing revisions of metadata for custom post type
  9. Custom field values deleted when trashing custom post type
  10. How to get all custom fields of any post type
  11. Update CPT meta data using REST API
  12. Admin Area Custom Type Search By Meta Fields Without Title & Content
  13. Echo all meta keys of a custom-post TYPE
  14. Custom Post type – how to get checkbox to update meta field to null
  15. How can I filter posts by post_parent in the admin?
  16. How do I Paginate Search Results for Custom Post Types?
  17. Ordering posts having multiple post-meta date fields
  18. Custom Post Type with Input fields to seperate table on database.
  19. How do I remove all the metaboxes for a custom post type?
  20. Custom Queries: Joining On Meta Values From Two Custom Post Types
  21. Gutenberg how to make attribute to save to meta
  22. How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?
  23. Post metadata deletes itself
  24. How to create a mini directory in WordPress?
  25. How Can I save multiple records in same meta key?
  26. Get all posts from custom post type and insert in select input as metabox
  27. Detect meta value changes when post is updated (post_updated)
  28. Search everything (posts, pages, tags, cpt, meta)
  29. Permalinks using event date (year & month) instead of publication date
  30. Custom Post Type: Set post_title equal to a custom post type field
  31. I can’t set meta_key in my custom post type query
  32. Grossly inefficient wordpress loops!
  33. Compare 3 custom fields and sort by oldest
  34. How Do I Use WP_Query to Run This Database Query as Search Result?
  35. WordPress Admin Panel search posts with custom post meta values along with title
  36. Creating a custom post type upon registration
  37. How to Update post status using meta data in Custom post TYpe
  38. Rest Api v2 orderby meta_key in custom post type
  39. bulk Update post_meta with default values
  40. Reason action hook won’t work with update_post_meta from frontend form? Alternative?
  41. Can’t sort order of wp_query with 2 meta keys
  42. Showing Meta Data for Custom Post Types?
  43. How to get source of custom meta image?
  44. Having trouble with custom post type / meta box
  45. Query for posts from any post type but only add instock products
  46. How can I include meta box content when searching?
  47. update a post meta from a single table cell TablePress
  48. update custom post type meta from a shortcode
  49. Custom Meta Boxes – Nonce Issue – Move to trash issue
  50. Displaying Meta Box Image
  51. Custom post type category not displaying in custom post type
  52. How to make custom post meta wp_editor translatable?
  53. Automatically adding meta data to posts or multiple query help
  54. How to keep a check box in custom meta box for custom post type checked by default for add new post?
  55. How to add multiple featured image in meta box in post editor?
  56. Show metabox in custom-post-template depending on taxonomy term?
  57. ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
  58. update_post_meta() whenever custom post type is updated
  59. Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
  60. Trigger “unsaved changes” dialog for custom post meta changes
  61. Using date stored as custom field to filter posts displayed in admin
  62. Conditionally Query Custom Post Types by Post Meta for Blog Home Page?
  63. Displaying custom posts only if custom meta box’s date is not expired
  64. Displaying Metabox value (custom post type taxonomy)
  65. How do I sort a custom post type admin column using two meta keys?
  66. Add Post Url to Manage Edit Screen
  67. How to best delete orphan wp_postmeta
  68. How can I display my custom metaboxes on a custom post template?
  69. Display all custom post type posts and order them by an optional meta_key
  70. Change the contents of a dropdown through the admin panel?
  71. Advanced search form with filters for custom taxonomies and custom fields
  72. Retrieve post data via WPDB class
  73. Top 30 Songs using Custom Post Type
  74. Advice Needed for Post Meta Database Efficiency
  75. fetch meta fields inside a widget
  76. Querying meta values within an array
  77. Create action running on trashed_post hook to modify post_meta value
  78. Post AND page parameter for WP function
  79. Random meta field from specific custom post type
  80. Custom post type – update_meta not working
  81. why get_post_meta is returning 0?
  82. Custom Post Type meta value is being saved in array, instead of just the string (as value)
  83. Save post_parent in a custom post type
  84. Custom Form Data save after Login User
  85. How to display Author Profile based on Custom field value
  86. Use a Variable in update_post_meta as the $meta_key
  87. Automatically add custom taxonomy when meta value gets to a set number or beyond
  88. Display a list of posts whose meta field values are equal to the ID of the post being viewed?
  89. Update an existing post in a custom post type
  90. Check for custom field value in different post type than current one and do something
  91. Changing to different post type maintains the redirection?
  92. Post Meta for Custom Post Types
  93. How do I add the “orange counter” next to a Custom Post Type?
  94. getEntityRecords/useEntityRecords: How to use CPT metadata?
  95. I am having a problem with fetching product data in the Gutenberg block editor
  96. CPT meta values intermittently return empty
  97. Quering a post object based on another related post object
  98. rest_api_init is not getting invoked inside a Class
  99. Normal Posts and Custom Posts with Date Query
  100. Optimizing storage of Post Meta Entries
Categories custom-post-types Tags custom-post-types, post-meta
How to disable image thumbnails from media manager but not post media uploader?
Help me edit a variable with php

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress