ThemeShaper Forums » Thematic

Copy and pasting code breaking theme

(3 posts)
  • Started 11 years ago by HuskerLiz
  • Latest reply from HuskerLiz
  • This topic is resolved


  1. HuskerLiz

    I was perusing the forum and just read one that was marked resolved, but the author had a note that he copied and pasted the code provided by Chris 4 times, which broke the theme, but on the 5th time it worked. I did this a couple of weeks ago with an issue, but I didn't persevere as this individual did. I spent so much time reworking to get the website even usable again that I haven't gone back in to address the original issue.

    My point on this is, is there something about copy and pasting the code that is an issue by itself? Should we type code which you give us rather than copying and pasting or is this just some anomoly?

    Posted 11 years ago #
  2. Hey,

    there's no issue with copy and paste at all .. I'm taking care of a proper wrapping when posting my code snippets to the forums. Sometimes rather than rewriting my own code I copy my own code posted here and copy it to my functions.php. And I never had a problem like this.

    There're two things you have to take care of .. first .. a 'proper' position where to paste your code .. pretty hard to define this. It's more or less about: Don't destroy your existing code or its structure by overwriting important things like a ';' at the end of a command line. Don't overwrite a opening '<?php' or a closing '?>'.

    Second .. don't use a standard text editor except you're working under Linux (Gedit supports highlighting). Use an editor like PSPad that's able to deal with PHP, HTML, CSS and so on. Looking at my first point .. you'll notice immediately that something went wrong during paste 'cause of the color change in highlighting PHP commands. A good PHP editor is able to check your php code for errors using php.exe.



    Posted 11 years ago #
  3. HuskerLiz

    Thanks for the info. This will help.

    Posted 11 years ago #

RSS feed for this topic


You must log in to post.