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

Display post_meta-by_key on product catalogue

That’s because get_post_meta_by_key() isn’t a WordPress function.

What you’re likely looking for is get_post_meta():

add_action( 'woocommerce_after_shop_loop_item', 'display_author' );

function display_author() { 
  global $post;
  echo get_post_meta( $post->ID, 'author', true );
}

Not tested, because I don’t have a WooCommerce install handy (and WooCommerce specifics are off-topic here anyway) but this is pretty standard so it should just work for you.

The true as the third parameter is so that get_post_meta() returns a string, ready to echo directly out. Without true, it will return an array instead (see the docs for further info).

Related Posts:

  1. How to add custom metakey to shop_order page’s searching function?
  2. How to display custom field in woocommerce orders in admin panel?
  3. How to create a custom order status in woocommerce!
  4. How to show product SKU on product page
  5. How to get woocommerce inventory status [closed]
  6. Woocommerce add to simple product attribute programmatically [closed]
  7. Apply jquery script to only woocommerce product pages and categories
  8. In WooCommerce I need to modify the thankyou.php page [closed]
  9. How can I add an extra WooCommerce hook
  10. Add options to featured image
  11. Change meta tags programatically
  12. How to Acheive the custom woocommerce category template
  13. Use a function to update post meta based on other post meta
  14. update_post_meta for custom field not working upon form submission
  15. Remove product description from product archive page
  16. Hide some items from Screen options in dashboard for products
  17. display 100 products per page on product category page [closed]
  18. Assign category using custom field?
  19. Adding WooCommerce to a Custom Theme – not working [closed]
  20. Issue adding text after short description on product pages Woocommerce [closed]
  21. Exclude Empty Child Categories in Menu
  22. Can you use admin pages functionality on the frontend of your site
  23. Convert User ID’s to User Names in a single.php file
  24. change billing and shipping address 1 and 2 field placeholders [closed]
  25. Creating loop within functions.php
  26. Override woocommerce wc-class function
  27. Display WooCommerce subscriptions for user [closed]
  28. replace text in Sort Box
  29. add_filter to specific WooCommerce Category
  30. Woocommerce checkout field
  31. Woocommerce image sizes missing from Appearance › Customize but not declared by theme
  32. add referrer to woo
  33. Way to redirect all Product Sub Category to its Main category Page?
  34. Add Login/Logout Menu Item to Primary Nav “My Account” Submenu [Woocommerce] [closed]
  35. Create a Woocommerce product widget with category filter
  36. Delay a function, any function!
  37. Auto scroll to id on page load on all pages except home page. Only do this on mobile
  38. How add body_class from wp_termmeta
  39. Adding product to WooCommerce cart [closed]
  40. Change WooCommerce add_to_cart Button Text?
  41. WooCommerce -> wc_enqueue_js not working [closed]
  42. Use existing image sizes for WooCommerce
  43. How to avoid saving empty data to sql while using add_meta_box
  44. How to change text color depending on the number value (Using javascript)
  45. Woocommerce Variable Product Dropdown for Custom Shop Template
  46. How to hide content on mobile in the functions.php file – woocommerce
  47. Woocommerce Default sorting product by product type
  48. How to hide WooCommerce product title and short description to non logged in users?
  49. localize_script but data changes dependent on product ID
  50. Changing the HTML of notices in WooCommerce [closed]
  51. Change class woocommerce on function.php
  52. Show ‘Add to Cart’ on Out of Stock products
  53. Hide ‘add to cart’ when certain value in dropdown is selected
  54. removing description tabs – single product page – breaks footer
  55. Update wp_postmeta table based on 2 keys
  56. Link product attribute value to a URL – woocommerce
  57. Remove text after a dot and a colon in Woocommerce product title
  58. When are the user meta fields created in the database? Admin vs Woo API REST
  59. price of product can’t return when get data of product in functions.php
  60. Woocommerce product price change
  61. Help with with my function for wordpress
  62. Remove clickable Link of WordPress Site Logo from Woocommerce Single Product page
  63. is_product_category(‘Services’) not working
  64. Problems adding a new field to product in cart
  65. blank page with wp_get_attachment
  66. Parent category as WOOCommerce Categories widget title
  67. Woocommerce Display Discount On cart
  68. Problem with my footer after changing WooCommerce Products Sorting [closed]
  69. Reference multiple style sheets, clearing styles for permalink page, custom fields for css
  70. Variable function names
  71. Override plugin function to show invoices even if not logged in
  72. How To Display Author Popup on Entry Meta (Genesis Framework)?
  73. Woocommerce – Switching Price for Category
  74. Creating a “Related Meta” type field?
  75. how can I change the read more link destinations and direct all to the same page?
  76. Woocommerce custom calculation function
  77. button to toggle css styling / div visibility?
  78. add product thumbnail to checkout page only and include variation name
  79. Echo a String Based On Geolocation? [Woocommerce || ACF]
  80. Execute jQuery with custom event listener after successfully add an item to the cart
  81. Move product attributes after summary on single product page
  82. Which method is more correct for removing WooCommerce Extensions menu item?
  83. Show number of sold products but be first for less than 2
  84. Remove post from latest posts after a month only with certain tag
  85. save_post doesn’t correctly process function call with php class
  86. function syntax is off,
  87. Return ACF Field value function
  88. Insert menu into theme location depending on user logged in/out status
  89. update_post_meta not working in function
  90. How To Get WordPress Categories Last Update Date?
  91. How to add a meta information to the URL?
  92. Automatically add custom fields (post_meta) to all published posts, hourly, via wp_cron?
  93. update_post_meta after form is submited
  94. Add custom fields after post/page title
  95. How to save custom made object in an array in a post meta field
  96. Get term count on a category page
  97. Woocommerce – Checkout error message
  98. add variable to actions/functions across different files (woocommerce)
  99. Adding and updating repeating custom field meta data
  100. reusing code in function and running it with loop
Categories functions Tags functions, post-meta, woocommerce-offtopic
Extracting Distance from FacetWP Proximity Function to Display in WordPress Template
query_posts works while get_posts doesn’t

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