November 21st, 2018

Have you ever wanted to write code on a tablet in a Tesla? I have.

Maybe not the most common problem, but since I want to work on this page, it would be nice to be able to edit some javascript.

But getting Javascript into your WordPress page is not something WordPress does nicely by default.  It does have some nice plugins like Advanced Custom Fields which lets you put fields into your WP posts so that you can render them later in templates.

So, essentially, it has a decent HTML editor.  But if you are like me, and you want to play with Javascript on your blog pages, then perhaps this plugin is right for you.

The way I use it is:

  1. Install Advanced Custom Fields if you haven’t already
  2. Install the acf-javascript plugin
  3. Add an ACF Javascript to my WP Posts called “code”
  4. In my WP Template put <script><?php the_field(‘code’); ?></script>

That is all.  This will enable you to write code like this:

Tada:

Posted In:

November 21st, 2018

ABOUT THE AUTHOR:
I am TSLA Long. Model 3 Owner. Brother of a Model 3 owner. Son of a Model S owner and Tesla enthusiast. Tesla Referral Code