WordPress Plugin ACF-Javascript
November 21st, 2018Have 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:
- Install Advanced Custom Fields if you haven't already
- Install the acf-javascript plugin
- Add an ACF Javascript to my WP Posts called "code"
- In my WP Template put <script><?php the_field('code'); ?></script>
Posted In:
ABOUT THE AUTHOR:Software Developer always striving to be better. Learn from others' mistakes, learn by doing, fail fast, maximize productivity, and really think hard about good defaults. Computer developers have the power to add an entire infinite dimension with a single Int (or maybe BigInt). The least we can do with that power is be creative.