[wp-hackers] Any tip about syntax highlight for worpress theme editor?

Jeremy Clarke jer at simianuprising.com
Thu Nov 11 15:56:16 UTC 2010


On Thu, Nov 11, 2010 at 8:29 AM, Rafael Ehlers <rafaehlers at gmail.com> wrote:

> I can´t find a syntax highlighter for the WordPress theme editor, only for
> inserting code (PHP, CSS, ...) in posts.
>
> Any tip on a plugin?
>

At one point there was a pretty elaborate JS editor-enhancement added to the
theme editor in core, but it was removed because it caused a lot of problems
for a lot of people. The problem with enhancing the wp-admin editor screens
is that if someone is actually using them then they are probably working on
a live site, and in that situation any issues can become nightmares.
Whatever is making someone use the theme editor instead of FTP+real editor
has a decent chance of also stopping them from being able to fix the site if
they break it using the theme editor.

Ideally the theme editor should never be used. It is an emergency tool
included because sometimes people get stuck with WP configured in an
inconvenient way. Rather than improve it you should fix your setup so you
don't have to use it at all.

Whatever your situation is that requires detailed edits to the theme, you
need to find another way to accomplish your goal. Most likely a local
installation using Mamp/xamp to run a copy of the site for development is
the best idea, that way you can use proper code editing tools and avoid
taking down the live site with a PHP syntax error. When you are happy with
how the theme works you can just paste in the results once.

Alternately, if you have a part of your theme that needs regular edits, you
should add some widget areas and control the content form the admin that
way. Much cleaner than editing the theme itself.

-- 
Jeremy Clarke | http://jeremyclarke.org
Code and Design | http://globalvoicesonline.org


More information about the wp-hackers mailing list