Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #729119

    Hello, I have set up some links in a page text in the visual editor. Everything works fine. Now I want to add some code to the links (these are links to PDF files and I want to track them with Google Analytics).

    The code I am trying to add is this:
    onclick=”ga(‘send’, ‘pageview’, {‘page’: ‘/documenten’, ‘title’: ‘PDF 1’});”

    So I go to the HTML Text editor instead of the visual text editor, and I add some code to my links. I save the changes and publice the page. Now, when I open the HTML Text editor again I see that the code I have added is gone…

    So somehow the HTML Text editor is not saving my changes to the code. What am I doing wrong here? And is this a Enfold problem or an WordPress problem? I am not sure, so that’s why I ask this question here first.

    Thank for your help!

    #729170

    Hey Alwin!

    We are afraid that is how WordPress work. If you switch back, it strips out any HTML added.
    You can try expand the links with some Jquery, but that would require to hire a developer to help you with the process.

    Thanks a lot

    Cheers!
    Basilis

    #729400

    Hey Basilis,

    If that’s the way WordPress works with the HTML Text editor, than what is the use of this text editor anyway?

    Sorry, I just don’t understand that..

    #729789

    Hi,

    You cannot add js code directly in a text editor unless you are using some kind of a plugin that supports this however in Enfold theme we have provided a codeblock element just for this purpose :)

    Please try adding your custom code using a code block.

    Best regards,
    Vinay

    #729821

    So if I understand it correctly then in the Text editor it is possible to change some HTML code.
    And it is possible to add HTML code?

    But it is not possible to add js code?

    #730152

    Hi,

    That is correct, you can read more about it here: https://codex.wordpress.org/Using_Javascript

    Best regards,
    Rikard

    #730274

    Thank you Rikard!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Text editor not saving changes’ is closed to new replies.