Title: PHP syntax error help. New to theme shaping.
Last modified: August 20, 2016

---

# PHP syntax error help. New to theme shaping.

 *  [Dovahkiin](https://wordpress.org/support/users/pictureesque/)
 * (@pictureesque)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/php-syntax-error-help-new-to-theme-shaping/)
 * Hey! I’m following a tutorial on [ThemeShaper](http://themeshaper.com/2009/06/26/wordpress-theme-header-template-tutorial/)(
   click link to see the current page I’m on) and I’m experiencing some errors that
   I have located, but I don’t know how to fix them (I’m new to PHP). Can you help
   me? The syntax errors are on lines 7, 13, 14 and 16 according to my editor. They
   are direct copy-paste from this tutorial, and I don’t know what I can do or replace
   them with. When I remove this code from the functions.php file, my site is invalid.
   When I add it, my site is working, but only until the get_page_number is called
   in the title in my index.php file. Does this make any sense to any of you? I 
   would appreciate your help!
 * The syntax errors are located in my functions.php file.
 *     ```
       <?php
   
       // Make theme available for translation
       // Translations can be filed in the /languages/ directory
       load_theme_textdomain( 'customtheme', TEMPLATEPATH . '/languages' );
        
       $locale = get_locale();
       $locale_file = TEMPLATEPATH . "/languages/$locale.php";
       if ( is_readable($locale_file) )
           require_once($locale_file);
        
       // Get the page number
       function get_page_number() {
           if ( get_query_var('paged') ) {
               print ' | ' . __( 'Page ' , 'customtheme') . get_query_var('paged');
           }
       } // end get_page_number
       ```
   
 * In my index.php file, the get_page_number is called through this code within 
   my <title></title> tags.:
 *     ```
       <?php
               if ( is_single() ) { single_post_title(); }
               elseif ( is_home() || is_front_page() ) { bloginfo('name'); print ' | '; bloginfo('description'); get_page_number(); }
               elseif ( is_page() ) { single_post_title(''); }
               elseif ( is_search() ) { bloginfo('name'); print ' | Search results for ' . wp_specialchars($s); get_page_number(); }
               elseif ( is_404() ) { bloginfo('name'); print ' | Not Found'; }
               else { bloginfo('name'); wp_title('|'); get_page_number(); }
           ?>
       ```
   
 * When I view source my code on my local server, this is what pops up:
 *     ```
       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
       <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
   
       <head profile="http://gmpg.org/xfn/11">
           <title>Dovahkiin | Just another WordPress site
       ```
   
 * There’s probably an easy fix to this 😉

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [13 years, 7 months ago](https://wordpress.org/support/topic/php-syntax-error-help-new-to-theme-shaping/#post-3175967)
 * Wow that is an old tutorial. Have you read the most [recent](http://themeshaper.com/2012/10/31/the-wordpress-theme-header-template)
   one?
 *  Thread Starter [Dovahkiin](https://wordpress.org/support/users/pictureesque/)
 * (@pictureesque)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/php-syntax-error-help-new-to-theme-shaping/#post-3175971)
 * Oh, I took Google results for granted… Thanks, I’ll look into this new tutorial!
 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [13 years, 7 months ago](https://wordpress.org/support/topic/php-syntax-error-help-new-to-theme-shaping/#post-3175976)
 * No problem! 🙂 They are up to the Archive template so far.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP syntax error help. New to theme shaping.’ is closed to new replies.

## Tags

 * [syntax error](https://wordpress.org/support/topic-tag/syntax-error/)
 * [theme development](https://wordpress.org/support/topic-tag/theme-development/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/php-syntax-error-help-new-to-theme-shaping/#post-3175976)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
