• Resolved tsimol2

    (@tsimol2)


    Hello.
    I created a chat group at chatango and copied the emded code to use in my wordpress webpage, but im not sure which is the best way to add this code. I used echo inside my child-theme to run the script. I did it this way but i’m pretty positive its not the correct way.

    1. Is this dangerous for my website?
    2. What is the best way to do what i want to do?
    3. Where can i find out how exactly to do it since im learning by doing so i don’t know a lot of things.

    Thank you for your time.

    The blog I need help with is aioanime.com

    Soory if this in not the correct place to ask for help if topic needs to be moved to it and inform me. thanks in regards

    • This topic was modified 6 years, 6 months ago by tsimol2.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • It seems like you have echo code in header.php file of your child theme. this is one of the correct way to adding our custom code to theme.
    As you said you have added code to your child theme this is not dangerous to your site.

    Thread Starter tsimol2

    (@tsimol2)

    Sorry my bad. I added the code in functions.php
    I just followed a guide on how to make a child cause i lack knowledge so according to the guide i only have functions.php and style.css

    Should i make a header.php to add it over there preferable?
    And if i’m to do that what is the way?
    Create header.php
    Add originals header.php info in comments in there
    enque it in functions.php the way i did with style.css ??

    Hello,
    Hardcode is not the proper way.
    Let me know where you want show that embed code result.
    If it is in the post or page, then you can use page or post editor to show it.
    thanks.

    Thread Starter tsimol2

    (@tsimol2)

    its a chatbox code, that copied from the chatbox’s website. its smth like
    <script> …. add chatbox.js + its css </script>

    its like facebook’s chat, show’s in bottom right corner and when you click it, it expands.
    i want it to show in every page

    hello,
    Its seems there may not any php code.
    its full of javascript and css.
    You just place your code in the header.php or footer.php file before closing of head tag.
    NO need to echo this. Browser will automatically render this.
    thanks.

    Thread Starter tsimol2

    (@tsimol2)

    please look at my 1st comment and answer me. Thanks

    Hello,
    copy header.php file from your parent theme folder and place that header.php file inside the child theme folder. there you go.
    Inside that header.php file put your code there before head end tag. Just open it , edit it and place that code in the header.php file which is inside your child theme.
    Hope you will do it.
    thanks.

    Thread Starter tsimol2

    (@tsimol2)

    that way when theme updates i need to do it again. Thank you for your help but i found a solution.

    Love to help you next time.
    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Adding Embed code to WP’ is closed to new replies.