Support » Themes and Templates » child theme functions.php issue

  • Resolved wen.wainwright

    (@wenwainwright)


    I’m trying to upload a child theme, twentythirteen-child, in a zip format. I have done this several times with no problem. However now I am getting this message:
    Parse error: syntax error, unexpected $end in /home/studiosahl/siteproject3.wendywainwright.com/wp-content/themes/twentythirteen-child/functions.php on line 1

    The first thing I did was make sure that my child theme functions.php only had <?php – then when I received a message (see above) I thought maybe something had changed and so I changed my functions.php to a completely blank file and got the above message again. Am I missing something really ridiculous here because I upload child themes all the time?

Viewing 11 replies - 1 through 11 (of 11 total)
  • wen.wainwright

    (@wenwainwright)

    Also this is really frustrating because it seems to break the entire site which requires a lot of busy work to get back up.

    esmi

    (@esmi)

    Forum Moderator

    Sounds like you have some non-visible characters at the very beginning of your theme’s functions.php file.

    wen.wainwright

    (@wenwainwright)

    Do you mean like I need to hit the backspace button to the very beginning and then re-save it?

    esmi

    (@esmi)

    Forum Moderator

    Yes. Try hitting backspace about 10 times at the very beginning of the file, re-save and re-upload it.

    wen.wainwright

    (@wenwainwright)

    With or without the <?php ?

    wen.wainwright

    (@wenwainwright)

    I’ve tried it with and without the <?php – obviously I am missing something small, but I normally do this several times a day! Is there something else small that I could be missing/doing wrong that happens to people often?

    esmi

    (@esmi)

    Forum Moderator

    You can download a pre-made Twenty Thirteen child theme from here if that helps.

    wen.wainwright

    (@wenwainwright)

    I’ll try that. In the meantime I’m deleting every last everything out of my databases, etc., just to clear out the muck. I upload child themes daily, no idea what my problem is.

    wen.wainwright

    (@wenwainwright)

    O.K. So I’ve decided that the problem is not in the functions.php or style.css. The problem must be in one of the other files I am uploading at the same time for the child theme. For example sidebar-header1.php or footer.php. So my final question is if it’s best to start a child theme with just a style.css and a functions.php or if it’s fine to load several files in a child theme and one of mine simply has a mistake elsewhere that causes this error but in general should be fine?

    esmi

    (@esmi)

    Forum Moderator

    In theory, every child theme just starts off with a style.css file. That said, I’ve created many a child theme that contains multiple files, so that, of itself, should never be a problem. The only thing I can suggest is that you start pulling out the other files one by one in the hopes of locating which file causing your problem.

    wen.wainwright

    (@wenwainwright)

    It still seems totally random and sometimes uploads fine and other times it doesn’t. Maybe I’m hitting save too quickly or something.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘child theme functions.php issue’ is closed to new replies.