Magento – How I Can Add Link In Header For Social Media Icon linksocial I am trying to find the option that how I can edit the link of google plus in header. I find in CMS > Static block but no success, Please help me, How can I edit or add the link Best Answer Here is how I did it. I was using my custom theme. Go to folder app/design/frontend/vendor_name/theme_name/Magento_Theme/layout/default.xml <referenceContainer name="header-wrapper"> <container name="custom.header" htmlClass="headerSitemenu" htmlTag="div"> <block class="Magento\Framework\View\Element\Template" name="social.links" before="-" template="Magento_Theme::social-links.phtml"> </block> </container> </referenceContainer> My custom .phtml file name is social-links.phtml. In this file I have the following code. This file is located at <mage-root>/app/design/frontend/vendor_name/theme_name/Magento_Theme/templates/social-links.phtml <?php /** * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ // Social Icons Bar // custom file added by Cameron Dixon ?> <?php echo $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('header_social_test')->toHtml();?> So my custom CMS Block name is "header_social_test" Related SolutionsMagento – Automatically Publish New Products to Social Media saveAction(): won't catch products added outside of an actual admin creating the product. _afterSave(): called any time the product is saved. Just be wary of that. The above information are foundational to deciding which is better for you (and your client's) purposes. Magento Blocks – Adding External JavaScript Link in Static Blocks To get the skin URL in cms page/static block. {{skin url="your-path"}} So now you can add script like below. <script src="{{skin url="your-path"}}"></script> Or else you can directly add script with in script tag Related TopicMagento – Add a category link to a CMS pageMagento – Magento 2: How to use an image within a linkMagento2 – Add Multiple Custom Links to Main Navigation via Plugin
Best Answer
Here is how I did it.
I was using my custom theme. Go to folder
app/design/frontend/vendor_name/theme_name/Magento_Theme/layout/default.xml
My custom .phtml file name is social-links.phtml. In this file I have the following code. This file is located at
<mage-root>/app/design/frontend/vendor_name/theme_name/Magento_Theme/templates/social-links.phtml
So my custom CMS Block name is