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:
- How to add custom metakey to shop_order page’s searching function?
- How to display custom field in woocommerce orders in admin panel?
- How to create a custom order status in woocommerce!
- How to show product SKU on product page
- How to get woocommerce inventory status [closed]
- Woocommerce add to simple product attribute programmatically [closed]
- Apply jquery script to only woocommerce product pages and categories
- In WooCommerce I need to modify the thankyou.php page [closed]
- How can I add an extra WooCommerce hook
- Add options to featured image
- Change meta tags programatically
- How to Acheive the custom woocommerce category template
- Use a function to update post meta based on other post meta
- update_post_meta for custom field not working upon form submission
- Remove product description from product archive page
- Hide some items from Screen options in dashboard for products
- display 100 products per page on product category page [closed]
- Assign category using custom field?
- Adding WooCommerce to a Custom Theme – not working [closed]
- Issue adding text after short description on product pages Woocommerce [closed]
- Exclude Empty Child Categories in Menu
- Can you use admin pages functionality on the frontend of your site
- Convert User ID’s to User Names in a single.php file
- change billing and shipping address 1 and 2 field placeholders [closed]
- Creating loop within functions.php
- Override woocommerce wc-class function
- Display WooCommerce subscriptions for user [closed]
- replace text in Sort Box
- add_filter to specific WooCommerce Category
- Woocommerce checkout field
- Woocommerce image sizes missing from Appearance › Customize but not declared by theme
- add referrer to woo
- Way to redirect all Product Sub Category to its Main category Page?
- Add Login/Logout Menu Item to Primary Nav “My Account” Submenu [Woocommerce] [closed]
- Create a Woocommerce product widget with category filter
- Delay a function, any function!
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- How add body_class from wp_termmeta
- Adding product to WooCommerce cart [closed]
- Change WooCommerce add_to_cart Button Text?
- WooCommerce -> wc_enqueue_js not working [closed]
- Use existing image sizes for WooCommerce
- How to avoid saving empty data to sql while using add_meta_box
- How to change text color depending on the number value (Using javascript)
- Woocommerce Variable Product Dropdown for Custom Shop Template
- How to hide content on mobile in the functions.php file – woocommerce
- Woocommerce Default sorting product by product type
- How to hide WooCommerce product title and short description to non logged in users?
- localize_script but data changes dependent on product ID
- Changing the HTML of notices in WooCommerce [closed]
- Change class woocommerce on function.php
- Show ‘Add to Cart’ on Out of Stock products
- Hide ‘add to cart’ when certain value in dropdown is selected
- removing description tabs – single product page – breaks footer
- Update wp_postmeta table based on 2 keys
- Link product attribute value to a URL – woocommerce
- Remove text after a dot and a colon in Woocommerce product title
- When are the user meta fields created in the database? Admin vs Woo API REST
- price of product can’t return when get data of product in functions.php
- Woocommerce product price change
- Help with with my function for wordpress
- Remove clickable Link of WordPress Site Logo from Woocommerce Single Product page
- is_product_category(‘Services’) not working
- Problems adding a new field to product in cart
- blank page with wp_get_attachment
- Parent category as WOOCommerce Categories widget title
- Woocommerce Display Discount On cart
- Problem with my footer after changing WooCommerce Products Sorting [closed]
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- Variable function names
- Override plugin function to show invoices even if not logged in
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- Woocommerce – Switching Price for Category
- Creating a “Related Meta” type field?
- how can I change the read more link destinations and direct all to the same page?
- Woocommerce custom calculation function
- button to toggle css styling / div visibility?
- add product thumbnail to checkout page only and include variation name
- Echo a String Based On Geolocation? [Woocommerce || ACF]
- Execute jQuery with custom event listener after successfully add an item to the cart
- Move product attributes after summary on single product page
- Which method is more correct for removing WooCommerce Extensions menu item?
- Show number of sold products but be first for less than 2
- Remove post from latest posts after a month only with certain tag
- save_post doesn’t correctly process function call with php class
- function syntax is off,
- Return ACF Field value function
- Insert menu into theme location depending on user logged in/out status
- update_post_meta not working in function
- How To Get WordPress Categories Last Update Date?
- How to add a meta information to the URL?
- Automatically add custom fields (post_meta) to all published posts, hourly, via wp_cron?
- update_post_meta after form is submited
- Add custom fields after post/page title
- How to save custom made object in an array in a post meta field
- Get term count on a category page
- Woocommerce – Checkout error message
- add variable to actions/functions across different files (woocommerce)
- Adding and updating repeating custom field meta data
- reusing code in function and running it with loop