Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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,
    Sadegh

    #756459

    Hi 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,
    Yigit

    #756463

    Hi 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,
    Sadegh

    #756464

    Hey!

    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.
    #756470

    Hi again,
    Thanks a lot :)
    and have a good one.

    Cheers!
    Sadegh
    (you may now close the thread please)

    #756471

    Hi!

    You are welcome dear Sadegh!
    Let us know if you have any other questions or issues :)

    Cheers!
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Custom HTML Code’ is closed to new replies.