title: WordPress meta title and description with Advanced Custom Fields
body: <p>I have a fully working code to collect the data of 2 meta fields (title and description) on all pages in case the auto generated (or empty) meta is not suitable. It works on every page exact 2:</p>
  <p>– The WordPress blog overview (archive)<br />
  – The WooCommerce shop page (also archive page)</p>
  <p>The 2 ACF fields within the pages look like to be totally ignored.</p>
  <p>Any reason for that? And how to overwrite this behavior?</p>
  <p>I understand that both pages are like kinda system pages where I can’t directly edit the content but I do want to edit the generated (or empty) meta data.</p>
  <p>Here’s the working code (except for the 2 archive pages):</p>
  <pre><code>// Add social media friendly meta tags
  function yl_add_meta_tags_to_wp_head() {
  
      setup_postdata( $post );
  
      $custom_meta_title          = get_field('yl_meta_title' );
      $custom_meta_description    = get_field( 'yl_meta_description' );
  
      if ($custom_meta_title) {
          $meta_title = $custom_meta_title;
      } else {
          $meta_title = get_the_title();
      }
  
      if ($custom_meta_description) {
          $meta_description = $custom_meta_description;
      } else {
          $meta_description = substr(wp_strip_all_tags(get_the_excerpt()),0,150) . '...';
      }
  
      echo '
          &lt;meta name=&quot;meta_name&quot; content=&quot;' . $meta_title . '&quot; /&gt;
          &lt;meta name=&quot;description&quot; content=&quot;' . $meta_description . '&quot; /&gt;
      ';
  
  }
  
  add_action( 'wp_head', 'yl_add_meta_tags_to_wp_head', 1, 1 );
  </code></pre>
  <p>EDIT:
  Let me be more clear: Why are the ACF fields in my shop page (backend) filled with data but complete ignored in the frontend source code...? (This behavior only happens on shop and archive pages).</p>