• Dears
    I am an older WP-user, trying to program a visual effect on a new post. I am impressed by the way chatGPT displays its text after an enquiry. I asked for the code and got this as an answer:

    Here’s an example of how we can use JavaScript and CSS to create a moving ChatGPT response: Then the three code snippets… which cannot be copied into this text.

    In this example, we first create a………….
    with a class of chatgpt-response and a tag inside of it. We style the
    and tags with CSS to make the text move across the screen. We then use JavaScript to set up an interval that changes the text in the
    tag every 5 seconds. The text is taken from an array of responses, and we cycle through the array using the modulus operator to loop back to the beginning once we reach the end.

    After installing WPCode I created three snippets but did not succeed to put everything in order. The new post shows a running text above the site header, even though I tried several combinations of placing the snippets.

    I would appreciate someone to help me on this. Thank you!

    Werner

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

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Maybe you should have asked chatGPT how to do that in WordPress 🙂

    External JS and CSS files in WP need to be enqueued with PHP code, but WPCode presumably does something differently, so I recommend asking in that plugin’s dedicated support channel.

    BTW, a lot of animation effects can be achieved with modern CSS alone. There is often no need for any JS to drive an animation. Animation via JS is “old skool” (but still works).

Viewing 1 replies (of 1 total)

The topic ‘Using CSS and JavaScript on a post’ is closed to new replies.