add_action hook-call not working
-
I’m trying to call a woocommerce hook via add_action. This code works like a charm if inserted directly into functions.php. However, it doesn’t execute if used within XYZ PHP.
Any recommendations for a pretty unexpirienced PHP beginner as why this is the case? Do I have to put the shortcode calling this at a particular part of the frontend in order for it to work? Does add_action not work at all with XYZ? Thank you!add_action(‘woocommerce_after_shop_loop_item_title’, ‘display_artist_link_grid’, 9 );
function display_artist_link_grid() {
$artist_link = get_field(‘artist_link’);
if ($artist_link) {
$title = $artist_link[‘title’];
$url = $artist_link[‘url’];
echo ‘‘ . esc_html($title) . ‘‘;
}
}
- The topic ‘add_action hook-call not working’ is closed to new replies.