• Im totally new to WP (as in….4 hours new…). Trying to implement my own template and ran across this error:
    Parse error: parse error in /home/pittsb50/public_html/sumaira/index.php on line 126
    Line 126 of my code is: </body>
    Am I missing something here?? I wrote my own XHTML and basically copied and pasted all the content from WP’s original index.php file into my own….just as a trial run so I can do some more css formating….and thats when i ran into this parse error.
    <?php
    /* Don't remove this line. */
    require('./wp-blog-header.php');
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml">
    <head profile="https://gmpg.org/xfn/1">
    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo('charset'); ?>" />
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->

    <style type="text/css" media="screen">
    @import url( <?php echo get_settings('siteurl'); ?>/scripts/blue.css );
    </style>
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <?php wp_get_archives('type=monthly&format=link'); ?>
    <?php //comments_popup_script(); // off by default ?>
    <?php wp_head(); ?>
    <meta http-equiv="Content-Language" content="en-us" />
    <meta name="robots" content="all" />
    <meta http-equiv="imagetoolbar" content="false" />
    <link rel="Shortcut Icon" href="/favicon.ico" type="image/x-icon" />
    <meta name="keywords" content="Sumaira, blogging, web design, movies, bollywood, pittsburgh, cooking, catholic, muslim, pakistani, italian, reading" />

    </head>
    <body>
    <div id="container">
    <div id="head"><h3><span>Sumaira.net - One day at a time</span></h3></div>
    <div id="banner"></div>
    <div id="right">
    <div class="sbtitle">About Sumaira</div>
    <div class="sbtext">22, a Leo. Web Designer. Married to Amir.</div>

      <?php get_links_list(); ?>
      <li id="categories"><?php _e('Categories:'); ?>
      <?php wp_list_cats(); ?>

    <li id="search">
    <label for="s"><?php _e('Search:'); ?></label>
    <form id="searchform" method="get" action="<?php echo $PHP_SELF; ?>">
    <div>
    <input type="text" name="s" id="s" size="15" />

    <input type="submit" name="submit" value="<?php _e('Search'); ?>" /></form>
    </div>
    </form>

    <li id="archives"><?php _e('Archives:'); ?>

      <?php wp_get_archives('type=monthly'); ?>

    <li id="calendar">
    <?php get_calendar(); ?>

    <li id="other"><?php _e('Other:'); ?>

    <li id="meta"><?php _e('Meta:'); ?>

    </div>
    <div id="content">
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <?php the_date('','<h2>','</h2>'); ?>

    <?php the_ID(); ?>">" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?>
    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(); ?>

    <?php the_content(); ?>
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>

    <!--
    <?php trackback_rdf(); ?>
    -->
    <?php include(ABSPATH . 'wp-comments.php'); ?>
    </div>

    </div>
    <div id="footer"><!--<?php echo $wpdb->num_queries; ?> queries. <?php timer_stop(1); ?> seconds. --> <cite><?php echo sprintf(__("Powered by WordPress"), __("Powered by WordPress, state-of-the-art semantic personal publishing platform")); ?></cite></div>
    </body>
    </html>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Run your site through the validator: https://validator.w3.org/
    A link to your site would help too if the validator doesn’t.

    Parse errors are a PHP issue and won’t be picked up by the validator, which checks only HTML. I suggest you copy and paste the PHP code over again; closing tags and semicolons can easily get missed out when selecting code, and then throw up parse errors.

    Thread Starter Sumaira

    (@sumaira)

    Actually, I worked backwards, pasting my css around the WP Template and it worked….not sure how but its working!
    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Parse Error when using new template…’ is closed to new replies.