I am using the Category and Taxonomy Meta Fields plugin to create some necessary fields in the product categories
.
When trying to display this information in php, it does not appear.
$cate = get_queried_object();
$cateID = $cate->term_id;
if (function_exists('get_all_wp_terms_meta'))
{
print_r( get_all_wp_terms_meta($cateID) );
}
in page archive-product.php
, return Array ( )
Use the plugin Advanced Custom Fields
In file archive-product.php
use:
$cateID = get_queried_object();
$return = get_field('NameField', $cateID);
if using a flexible field, name the layout in the field settings and use
if ( have_rows( 'NameItem', $cateID ) ) :
while ( have_rows( 'NameItem', $cateID ) ) : the_row();
if( get_row_layout() == 'NameLayout' ):
echo get_sub_field('NameFiel');
endif;
endwhile;
else :
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.