Should ‘setup_postdata()’ be reset with ‘wp_reset_postdata()’?
Starting with an example makes more sense, so here’s an example function: function seo_meta_tags() { global $post; if( is_singular() ) { setup_postdata( $post ); $description = str_replace( ‘… <a class=”read-more” href=”‘ . get_permalink() . ‘”>Cont. reading →</a>’, ‘…’, get_the_excerpt() ); wp_reset_postdata(); echo ‘<meta itemprop=”description” name=”description” content=”‘ . $description . ‘”>’; } } NOTE: The code … Read more