CustomField via function not appearing
-
Hello,
I want to display a custom field on the products listing page (WooCommerce), but it doesn’t appear.
My code (functions.php) in child theme:
// Productkatalog test function add__woocommerce_after_shop_loop_item( ) { echo get_post_meta($post->ID, 'wbo_literpreis', true); }; add_action( 'woocommerce_after_shop_loop_item', 'add__woocommerce_after_shop_loop_item' );This just displays nothing
When echoeing on the same spot, it displays the custom field (and others ofc) to be there:
// Productkatalog test function add__woocommerce_after_shop_loop_item( ) { echo the_meta(); }; add_action( 'woocommerce_after_shop_loop_item', 'add__woocommerce_after_shop_loop_item' );Unfortunately I’m not that PHP experienced.
What am I missing?Thanks in advance!
Pascal
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘CustomField via function not appearing’ is closed to new replies.