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

why get_post_meta is returning 0?

Please try below code and check if ‘sound_s‘ key exists in the array or not

$file_id = get_post_meta($post_id);
echo "<pre>";
print_r( $file_id );
exit;

Related Posts:

  1. Grossly inefficient wordpress loops!
  2. Displaying custom posts only if custom meta box’s date is not expired
  3. get_template_part() – post-meta not working?
  4. Create a random unique 6 digit number as custom field for custom post type
  5. Meta Key Value in current-user-only loop
  6. Create Array from custom post type to display a slider
  7. How to retrive Custom Post Type Meta Fields in Custom WP_Query
  8. Custom meta fields not showing up in WP_Response Object via custom endpoint
  9. get_post_meta for Custom Post Type ( CPT )
  10. How to create content automatically when a post is published?
  11. WordPress request fiter order by related post’s post_title
  12. Post ID randomly printing on page
  13. A custom post within a custom post
  14. Display Custom Taxonomy Alphabetically
  15. Full Custom Post Type List Organised by two Taxonomies
  16. Displaying Custom Posts on a Page
  17. Shortcode not working with post counter
  18. Problem: wp_query outputs all images on site
  19. Update database from Quick Edit according to Checkbox state of Custom Post Type
  20. Custom fields (wp_post_meta) vs Custom Table for large amount of data
  21. Get custom post type’s fields in a while loop as variables
  22. Storing a many to many post type relationship in post meta and keeping SQL ability for Joins
  23. Custom Post Type within the Loop on Homepage (Page Template)
  24. Dynamic Custom Fields
  25. The loop seems stuck to a single (now deleted) post
  26. Show Custom Post Type meta boxes only on Page Edit
  27. Posts per row on archive page (custom post type)
  28. How do I know the ‘meta_key’ for ordering my custom post type
  29. Custom filter function not working with Custom post type
  30. Custom Theme With Custom Loops
  31. Custom Post Types strange pagination problem
  32. Custom post type conditional in loop
  33. Importing Data from a Non-WordPress database, into WP
  34. Listing all term items alphabetically / sorting loop
  35. Getting thumbnails of a custom posts featured images in a page-templates metabox
  36. Display related custom taxonomy posts in sidebar
  37. List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?
  38. Remove Post Custom Meta Box
  39. pagination not working for category.php (custom post types in categories)
  40. Can’t publish custom post type – “You are not allowed to edit this post.”
  41. Only show posts with date of today or in the future (i.e don’t show past posts)?
  42. How do I control the output of a custom post type in the loop?
  43. Display custom post type posts first, then default posts
  44. Custom Post Type Category Link
  45. Custom Post type category pages template and loop
  46. Custom fields for custom post type
  47. Three Most Recent Posts, One Per Term
  48. Targeting custom post type
  49. Show future events based on custom field AND order by date
  50. Does WP have a global of $id?
  51. WordPress Loop if/else
  52. get_the_title() is returning results from previous loop
  53. Meta Data for Custom Post Type not saving
  54. Using preg_replace to filter custom textarea
  55. Custom Post Loop pulling all custom posts, not just one
  56. Conditional for a Single Post That Belongs to a Category?
  57. Wrapping x posts in html without leaving empty html
  58. WP Query post__in not returning correct results
  59. Custom Post Type single.php template only shows the latest post
  60. Sort posts in loop by the WooCommerce Membership of the author
  61. Check if post with same meta value exists
  62. Filter date from post meta when date is in string format
  63. Including all post id’s of a custom post type into an array
  64. How to include custom post type posts on a page?
  65. 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
  66. Tag page only display 10 posts
  67. Get only used meta_values
  68. If Post Meta Equals Current Title Conditional Advanced Custom Fields
  69. Is there a way to exclude posts based on meta_values?
  70. Do posts, pages and / or custom post type objects have unique ID numbers or can there be multiple objects with the same IDs?
  71. How can I group posts by months and years?
  72. Pagination Error : Duplicate argument being outputted
  73. get_post_type is always post
  74. Archieve.php not loading for custom post type
  75. Multiple Custom Post Type queries, how to DRY it up
  76. Custon Content within WordPress Loop
  77. Trying to Create a PHP Variable for post_type that can be referenced Site Wide
  78. Bootstrap accordion looping through posts incorrectly
  79. Main query not querying any posts in custom taxonomy template
  80. Loop increase number
  81. Custom post type showing same Post on all Pages
  82. Submitting Custom Post Types with custom fields from Front-end form
  83. get_post_meta is not working inside shortcode
  84. Using wp_query to modify the loop in index.php for a CPT
  85. the_post() is printing titles in page footer
  86. create custom meta box with default value
  87. Custom WP_Query doesn’t display all posts
  88. Get $post->ID from a URL
  89. Displaying a div from an assigned meta_value when on a page
  90. Query & the_content() is showing in the header
  91. Meta data (Tags and Categories) for Custom Posts not showing.
  92. Display different information of a custom post type
  93. Setting Post Title via Meta Data returns Auto-draft
  94. How to Echo Metadata Value in Currency Format
  95. Issue on Working with Metabox – Checkbox to enable Sale Items
  96. Filter posts by tax (dropdown) and meta value
  97. delete_post_meta() for whole CPT / multiple posts?
  98. Move Genesis Single Page/Single Post Title
  99. get parent content inside child posts
  100. 3 random images from custom post type, each in a div with a diffrent class
Categories custom-post-types Tags custom-post-types, loop, post-meta
How to store queried custom data and use it in multiple pages?
How to print array of specific item

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
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 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