WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] child theme functions.php issue (12 posts)

  1. wen.wainwright
    Member
    Posted 5 months ago #

    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?

  2. wen.wainwright
    Member
    Posted 5 months ago #

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

  3. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

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

  4. wen.wainwright
    Member
    Posted 5 months ago #

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

  5. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

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

  6. wen.wainwright
    Member
    Posted 5 months ago #

    With or without the <?php ?

  7. wen.wainwright
    Member
    Posted 5 months ago #

    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?

  8. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

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

  9. wen.wainwright
    Member
    Posted 5 months ago #

    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.

  10. wen.wainwright
    Member
    Posted 5 months ago #

    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?

  11. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

    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.

  12. wen.wainwright
    Member
    Posted 4 months ago #

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

Reply

You must log in to post.

About this Topic