Add Rich Snippets Magento 2

I have the following code, which I have appended to the opengraph/general.phtml file in Magento 2.

I am hoping this will add the rich snippet data required by Google, but I am receiving an error (blank page).

Existing Code of opengraph/general.phtml

    <?php /**  * Copyright © Magento, Inc. All rights reserved.  * See COPYING.txt for license details.  */  // @codingStandardsIgnoreFile  /** @var $  block \Magento\Catalog\Block\Product\View */ ?>  <meta property="og:type" content="product" /> <meta property="og:title" content="<?= $  block->escapeHtmlAttr($  block->stripTags($  block->getProduct()->getName())) ?>" /> <meta property="og:image" content="<?= $  block->escapeUrl($  block->getImage($  block->getProduct(), 'product_base_image')->getImageUrl()) ?>" /> <meta property="og:description" content="<?= $  block->escapeHtmlAttr($  block->stripTags($  block->getProduct()->getShortDescription())) ?>" /> <meta property="og:url" content="<?= $  block->escapeUrl($  block->getProduct()->getProductUrl()) ?>" /> <?php if ($  priceAmount = $  block->getProduct()->getFinalPrice()):?>     <meta property="product:price:amount" content="<?= /* @escapeNotVerified */ $  priceAmount ?>"/>     <?= $  block->getChildHtml('meta.currency') ?> <?php endif;?>  <?php /** Rich Snippet Code */ ?>      <?php $  _product = $  this->getProduct(); $  _brand = $  this->getBrand($  _product); $  _sku = $  this->getSku($  _product);  ?>  <script type="application/ld+json">     {         "@context": "",         "@type": "Product",         "name": "<?php /* @escapeNotVerified */ echo $  block->escapeQuote($  block->stripTags($  _product->getName())); ?>",         "image": "<?php /* @escapeNotVerified */ echo $  block->stripTags($  block->getImage($  _product, 'product_base_image')->getImageUrl()); ?>",         "description": "<?php /* @escapeNotVerified */ echo $  block->escapeQuote($  block->stripTags($  block->getDescription($  _product))); ?>", <?php if (strlen(trim($  _brand))): ?>         "brand": {             "@type": "Thing",             "name": "<?php echo $  block->stripTags($  _brand); ?>"         }, <?php endif; ?>         "offers": {             "@type": "Offer",             "priceCurrency": "<?php echo $  block->getCurrencyCode() ?>",             "url": "<?php echo $  block->stripTags($  block->getCurrentUrl($  _product)); ?>", <?php if ($  _product->isAvailable()): ?>             "availability": "",  <?php else : ?>             "availability": "", <?php endif; ?>             "price": "<?php echo $  this->getPrice(); ?>",             "priceValidUntil": "<?php echo $  _product->getSpecialToDate(); ?>"         }     } </script> 

Can anyone please advise a solution?

How to let VSCode snippets suggest angularjs directives only as atributes?

My snippets are suggesting angularjs directives everywhere, not only in html tags as attributes.

I have this snippet now.

{     "ng-app": {         "prefix": "data-ng-app",         "body": "data-ng-app=\"app\"$  0"     },     "ng-bind": {         "prefix": "data-ng-bind",         "body": "data-ng-bind=\"$  1\"$  0"     },     "ng-bind-html": {         "prefix": "data-ng-bind-html",         "body": "data-ng-bind-html=\"$  1\"$  0"     },     "ng-bind-template": {         "prefix": "data-ng-bind-template",         "body": "data-ng-bind-template=\"$  1\"$  0"     },     "ng-controller": {         "prefix": "data-ng-controller",         "body": "data-ng-controller=\"$  1\"$  0"     },     "ng-model": {         "prefix": "data-ng-model",         "body": "data-ng-model=\"$  1\"$  0"     },     "ng-view": {         "prefix": "data-ng-view",         "body": "data-ng-view=\"\"$  0"     } } 

Expected: suggest only if cursor is at this position

“|” = cursor

Current: Suggest everywhere

Rich snippets code and site name in search engine results?

Where do i add reviews code and site name in search engine results code for my website. If i add to home page every one will be able to see.I saw there are some websites published with reviews but the code not in homepage. Suggest me how to do..i need help urgently..Thanks in Advance.. and after adding how long will it take it is to be published in search engine results…Please let me know…

Code Snippets plugin by Shea

I just downloaded Code Snippets for my WordPress website that looks really promising for a newbie like me. I’m getting ready to create some snippets and I’m concerned about any potential errors causing my site to shut down (I just had that happen yesterday when I tried to enter snippets in my Highend Child theme. I needed to be rescued by my webhost customer service).

I see in the FAQ on this page,, a person asked about this potential. Shea said it’s possible to activate safe mode by adding the following line to your wp-config.php file, just before the line that reads /* That’s all, stop editing! Happy blogging. */:

define(‘CODE_SNIPPETS_SAFE_MODE’, true);

Trouble is I can’t find where wp-config.php file is. I did find under Appearance-Edit Themes-Theme files there is a plain config.php file but I couldn’t find the line that reads as above to know where to safely put this line.

Just trying to play it safe before I start creating code snippets and possibly break my site! Thanks