[Support request] adding script code on single page or post

Home Forums Support [Support request] adding script code on single page or post

Home Forums Support adding script code on single page or post

  • This topic has 10 replies, 2 voices, and was last updated 2 years ago by David.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #2169529
    Yaeko

    hi.I am trying to add some chat apps on my site. currently I did add code with elementor. somehow I need to change my direction. I want to add code on single page. chat manual says copy and paste just before closing </body> tag, but on code editor mode on each page, I can not find </body> tag. so is there anyway that I can achieve it?
    thanks!

    #2169539
    David
    Staff
    Customer Support

    Hi there,

    For sure – follow these steps:

    1. Enable the Elements Module in Appearance > GeneratePress.

    2. Then Create a New Hook Element in Appearance > Elements:

    https://docs.generatepress.com/article/hooks-element-overview/

    2.1 In the Hook text area add your chat app script.

    2.2 Select the Hook: wp_footer

    2.3 Set the Display Rules to the Entire Site or the specific pages you want the chat app displayed.

    2.4 Publish the hook.

    #2169543
    Yaeko

    thank you for quick reply!
    yes I know, I am using elements and hook.
    but I rather want to try single page.
    is there any way that I can do?

    #2169576
    David
    Staff
    Customer Support

    Why not just set the Element Display Rule to the single page you want it applied to?

    The only alternative is to add it to the page in the editor using a HTML Block.
    But it won’t be just before the </body> tag

    #2169581
    Yaeko

    I understand your question that not using element.
    I am on learning curve. that is first.

    I am building site that 2 languages. Japanese and English. Both language I have original text, not auto translation.
    which means I do not require polylang or any other multi lingual plug in. only give different slug /ja or /en.
    in which case, hook unable to find out which page is japanese or english. (mind you, Not using polylang, so each page or post no identify language!)

    does it make sense to you?

    #2169592
    David
    Staff
    Customer Support

    Is it possible to see an English and a Japanese language page ?

    #2169596
    Yaeko

    Japanese site almost complete.
    English page, I just duped japanese page to english, only home is uploaded. but yes, sure, please.
    also if you want to log in, I can create user for you. do let me know.

    #2169603
    David
    Staff
    Customer Support

    So will you be creating ‘english’ copies of every page ?

    #2169604
    Yaeko

    copy the layout, put in original english text. so answer is yes, sir.

    #2169649
    Yaeko

    so it seems only way is I have to rule out exclude english hook on japanese page. am I right?

    #2169676
    David
    Staff
    Customer Support

    Yes, with your current setup you would need to Exclude all Japan pages for the english chat. And All the English Pages for the Japan chat

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.