Posted By

kaynechu on 04/02/14


Tagged


Versions (?)

Display Custom Field for Product Categories


 / Published in: PHP
 

This example for meta tags

  1. <?php $taxonomyID = get_queried_object()->term_id;
  2.  
  3. //$metaname=get_field('meta_name', 'product_cat_' . $taxonomyID);
  4. $metacontent=get_field('meta_content', 'product_cat_' . $taxonomyID);?>
  5. <?php if ($metacontent) { ?>
  6. <meta name="description" content="<?php echo $metacontent; ?>"/>
  7. <?php } else { ?>
  8. <?php woo_meta(); ?>
  9. <?php } ?>

Report this snippet  

You need to login to post a comment.