[Support request] how to add customize code at my single product page

Home Forums Support [Support request] how to add customize code at my single product page

Home Forums Support how to add customize code at my single product page

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2335941
    xinghui

    I wrote a simple code for an accordion and wanted to add it to my product page. I used the code of generatepress blocks. I wrote my code directly in it and saved it to the hooks block. I went to the product page to check and found My code is still displayed, how can I add my product content to the product page correctly, in addition, I added javascript code to my code, does woocommerce support this language? Does it matter?
    there is my problem image:

    #2336149
    David
    Staff
    Customer Support

    Hi there,

    the <code> block is for showing code on your website.
    If you wanat to add code such as <link> <style> <script> to your site then:

    1. Use a Hook Element:

    https://docs.generatepress.com/article/block-element-hook/

    2. You can add any code you need within the hook text area.

    3. Choose either of these hooks for adding code.

    i) wp_head for inserting code into the <head> of your site. best used for <link> and <styles>
    ii) wp_footer for inserting code into the footer of your site. Best for <scripts> that have to be loaded after HTML.

    4. Set the Display Rules for your Products

    DO NOT Add this kind of code:

    <!DOCTYPE html>
    <html>
    <head>
    <meta name= "viewport"
    

    The theme already does that and you don’t want duplicates of those.

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