-
AuthorPosts
-
March 6, 2017 at 3:32 pm #756458
Hi,
I know it’s a very basic question :)
We’ve been asked to: “Paste it -code lines- to your HTML code. Make sure you add it to the body section of your website”
May I know where can we do that?Regards,
SadeghMarch 6, 2017 at 3:36 pm #756459Hi Sadegh!
You can use Code Block element or Text tab of Text Block element to add HTML to your website. You can also use Text widget if you would like to place it in a widget area
Regards,
YigitMarch 6, 2017 at 3:47 pm #756463Hi dear Yigit,
I thought it should be placed somewhere else in theme files.Here is the code:
<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Blog", "url": "http://maga.co.ir/blog" } </script> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Organization", "name": "آتي گستر", "url": "http://maga.co.ir", "sameAs": [ "https://www.facebook.com/magaatigostar/", "https://twitter.com/AtiGostar" ] } </script>
So, should I still paste this code in code block element in the first page of the website?
Regards,
SadeghMarch 6, 2017 at 3:51 pm #756464Hey!
If you would like to echo it on all pages, you can add following code to Functions.php file in Appearance > Editor as well
function my_custom_body_code(){ ?> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Blog", "url": "http://maga.co.ir/blog" } </script> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Organization", "name": "آتي گستر", "url": "http://maga.co.ir", "sameAs": [ "https://www.facebook.com/magaatigostar/", "https://twitter.com/AtiGostar" ] } </script> <?php } add_action('wp_footer', 'my_custom_body_code');
Cheers!
Yigit- This reply was modified 7 years, 8 months ago by Yigit.
March 6, 2017 at 4:01 pm #756470Hi again,
Thanks a lot :)
and have a good one.Cheers!
Sadegh
(you may now close the thread please)March 6, 2017 at 4:03 pm #756471 -
AuthorPosts
- The topic ‘Custom HTML Code’ is closed to new replies.