• Hello,

    I’m currently working through Ian Stewart’s WordPress Theme Tutorial and I’m stuck.

    I’m currently on Mac OS 10.3.9 … haven’t updated because I would have to update all other software which is too costly … so can’t install MAMP.
    I’ve therefore been testing the tutorial straight onto my server (1&1) transfering files via ftp using cyberduck. Then checking them out using Firefox.

    I’ve gotten to step 6 of this tutorial when they talk about the loop.

    I tried entering the first set of code into the index.php file as noted
    <?php while ( have_posts() ) : the_post() ?>
    <?php the_content(); ?>
    <?php endwhile; ?>

    and then copying the files footer.php, functions.php, header.php, index.php to my server in order to see what’s happening.

    I get the following message when trying to acces my admin panel:
    Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in /homepages/11/d352022585/htdocs/blog/wp-content/themes/WP_Scratch1/functions.php on line 7

    Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in /homepages/11/d352022585/htdocs/blog/wp-content/themes/WP_Scratch1/functions.php on line 8

    Parse error: syntax error, unexpected T_STRING in /homepages/11/d352022585/htdocs/blog/wp-content/themes/WP_Scratch1/functions.php on line 11

    I thought the functions.php file must not be finished as we might be working on it more later in the tutorial, so I deleted from the server. I can now access my admin panel but when I go to preview the blog this is what I get:

    {\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \paperw11904\paperh16835\margl1440\margr1440\vieww24000\viewh13540\viewkind0 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f0\fs24 \cf0
    Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in /homepages/11/d352022585/htdocs/blog/wp-content/themes/WP_Scratch1/header.php on line 11

    Parse error: syntax error, unexpected T_IF in /homepages/11/d352022585/htdocs/blog/wp-content/themes/WP_Scratch1/header.php on line 12

    At this point I tried to find the errors but no dice … I’m not sure if I’m getting this just because I’m testing it straight onto my server rather than through MAMP (therefore, I should just trawl forward through the tutorial until the files are complete) or if I’ve done something wrong.

    I’d really like understand
    I appreciate any help you can give or direction you can point me in.

    thanks very much for your time.
    ToDd

Viewing 2 replies - 1 through 2 (of 2 total)
  • It’s better to start with a very simple theme and customize it the way you want to look like. And then when you’ved done quite a few then maybe that’s the time to build a whole new theme from scratch.

    This is what I am doing right now to familiarize myself with the internal code and I sometime still get stuck. It is much quicker to solve the issue though cause I can back pedal.

    Yes, for start is the best to use an existing WP them e to customise, than to start everything from scratch…
    There is a great book about theme design that I can recommend:
    https://www.amazon.com/WordPress-Theme-Design-complete-professional/dp/1847193099

    The problem you mentioned is probably related to the functions.php being encoded differently than WP expects, as it is the most sensitive file in the whole template structure, even some erroneous carriage returns, or empty lines before <?php can make the whole WP installation stop functioning. My suggestion is to use for start some existing functions.php from a working theme, and make the needed modifications there. Also, be sure you use some good text editor (not sure which it is for mac, maybe TextEdit? for PC it is the Notepad or Notepad++) or the inbuilt Theme editor and never some program like Word-pad, MS word…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Building Theme from Scratch’ is closed to new replies.