wordpress - WooCommerce Category and ACF -


i'm using advanced custom fields (acf) plugin. on woocommerce product category, want have content area seo. acf me doesn't work, nothing shown on front end of site.

content-product.php has the field:

<li <?php post_class(); ?> style="max-width:<?php echo $column_width; ?>px">     <div class="mk-product-holder">     <?php do_action( 'woocommerce_before_shop_loop_item' ); ?>          <div class="mk-love-holder">         <?php if( function_exists('mk_love_this') ) mk_love_this();      ?>         </div>          <h3><a href="<?php echo get_permalink();?>"><?php the_title(); ?></a>          // here extrafield seo-text, field registered in fields name "extratext"         <?php echo get_field('extratext'); ?>                 </h3>     </div> </li> 

woocommerce category screenshot: http://www.directupload.net/file/d/3952/kzb8dcjk_png.htm

you haven't set $postid parameter get_field() function it's defaulting current post object (which first post in category). see get value other places section in documentation instructions on how field other places: http://www.advancedcustomfields.com/resources/get_field/.

so you'll want write this:

<?php $queriedobject=get_queried_object(); echo get_field('extratext','product_cat_'.$queriedobject->term_id); ?> 

Popular posts from this blog