If you need to set custom field for product tag page, this code will help you.
1 2 3 4 5 6 7 8 9 10 11 12 |
function custom_aioseo_title_for_product_tag($title) { // Check if the current page is a product tag archive if (is_tax('product_tag')) { $term = get_queried_object(); $new_title = get_field('meta_tag_title', $term); if ($new_title) return $new_title; } // Return the original title for other pages return $title; } add_filter('aioseo_title', 'custom_aioseo_title_for_product_tag'); |
In this example code changing title meta tag for product tag page.