简体   繁体   中英

Add php code after product price on shop and archive pages

Link attached image

I am trying to add code php after price (not on single product pages) but on sshop pages and archive page (As image).

The php code I want to insert is:

<?php the_author_meta( 'phone' ); ?>

Looking forward to the help of experts. Sincerely thank !

Try this added to your functions.php:

Modify to your needs.

function woocommerce_after_cat_price() {
    echo the_author_meta( 'phone' );
}
add_action('woocommerce_after_shop_loop_item', 'woocommerce_after_cat_price', 10, 0);

Than you very much. I did it. Also with this code, I want to insert below the price of the product page as shown. Looking forward to your help.

Thank you

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM