0

Do I just go to Appearance->Editor and then pick the template and modify the PHP code directly, or is there a more "non-coding" way of doing it?

I'm using a theme with a contact form, and the whole contact form code is in the template, and the edit page window just shows up blank. All the code is in the template.

2 Answers 2

2

All code will be in the template. That is how custom templates work.

Altering the output those templates is a code edit except where the templates have been written to include the post body, or meta fields, etc.

But don't go to Appearance->Editor and start hacking away. First, if this isn't your theme you are going to have to redo the work when you update the theme, and second, if you make a mistake in the built in editor you can take the whole site down and not be able to get back in to edit the file. I consider that editor the equivalent of working on an airplane while it is in the air.

Instead, grab the file via FTP, edit it is a text editor, preferably one intended for code, then reupload it. Ideally, you'd set up a development server on your computer so that you can not only edit but test the changes before pushing them live.

3
  • Thanks. I'm surprised it is "wordpress friendly" to have so much of the site in the Template. If I were designing a theme, I'd think the users of the theme would want easier access to such things. Good to know that editing the code is the only way. Cheers.
    – Joel
    Commented Jul 18, 2013 at 17:10
  • 2
    It is WordPress friendly to separate the design from the content, I think. I sort of disagree that a contact form should be part of the theme in the first place. If you change themes, you lose your form. That's an example of something more-suited as a plugin. There are plenty of form plugins that would let you customize the form from the WP backend and insert it as a post. Commented Jul 18, 2013 at 17:31
  • agreed. I love Gravity Forms.
    – Joel
    Commented Jul 18, 2013 at 18:10
0

I use Max's HTML Beauty to edit theme files. It was free (think it still is) and helps edit templates by highlighting code elements.

Contact form 7 is a decent form option as well. The form is then separate from the template and stays with you if you change themes.

Good Luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.