• Resolved MCWebdesign

    (@mcwebdesign)


    HI There,

    Having a problem with a theme I’m building, most of the code is copied from another theme or the wordpress codex but the best i can get is a print showing an error on line 4.

    Parse error: parse error in C:\xampp\htdocs\wordpress\wp-content\themes\mcwebdes1\index.php on line 4

    I have checked the loop by changing the index to the basic loop and that doesn’t help. I’ve been through the header below inch by inch but can’t work out what might be wrong!

    Any ideas?

    Thanks

    Matt

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;
    <html xmlns=”https://www.w3.org/1999/xhtml&#8221; <?php language_attributes(); ?> >
    <head>
    <meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>” charset=”<?php bloginfo(‘charset’); ?>”/>
    <title>
    <?php wp_title(‘«’, true, ‘right’); ?>
    <?php bloginfo(‘name’); ?>
    </title>

    <style type=”text/css” media=”screen”>
    <?php bloginfo(‘stylesheet_url’); ?>
    /*@import url( <?php bloginfo(‘stylesheet_url’); ?> );*/
    </style>

    <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(); ?>
    </head>
    <body>

    <div id=”container”>

    <div id=”header”>
    <h2>
    <a href=”
    <?php bloginfo(‘url’); ?>/”>
    <?php echo bloginfo(‘name’); ?>

    </h2>

    <div id=”search”>
    <?php get_search_form(); ?>
    </div>

    </div>

    <div id=”menu”>

      <?php wp_list_pages (‘title_li=’); ?>

    </div>

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator James Huff

    (@macmanx)

    Remove the single > on line 4 of the index.php file you posted.

    Thread Starter MCWebdesign

    (@mcwebdesign)

    Hi thanks for that tip, but it hasn’t made tha slightest difference. I have posted the index.php file below (above was the header.php). perhaps there’s something there?

    Thanks again

    Matt

    <?php get_header(); ?>

    <div id=”content”>
    <? php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class=”post”>

    <div class=”postheader”>
    <!– Display the Title as a link to the Post’s permalink. –>
    <h3>

    rel=”bookmark”
    title=”Permanent Link to <?php the_title_attribute(); ?>”>
    <?php the_title(); ?>

    </h3>

    <!– Display the date (16th November, 2010 format) and a link to other posts by this posts author. –>
    <small>
    <?php the_time(‘jS F, Y’) ?>
    by
    <?php the_author_posts_link() ?>
    under the category: <?php the_category(‘| ‘); ?>
    </small>

    </div>

    <!– Display the Post’s Content in a div box. –>
    <div class=”entry”>
    <?php the_content(‘Read the rest of this entry »’); ?>
    </div>

    <!– Display a comma separated list of the Post’s Categories. –>
    <p class=”postmetadata”>
    Tags <?php the_tags(‘, ‘); ?> </p>

    </div>

    <? php endwhile; else: ?>
    <p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
    <? php endif; ?>
    </div>

    <?php get_sidebar (); ?>

    <?php include(“socialbar.php”); ?>

    <?php get_footer (); ?>

    <? php if (have_posts()) : while (have_posts()) : the_post(); ?>

    There’s a space in the beginning of the php-code, write like this:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    And there’s code missing in the beginning right after <h3>

    <h3>

    rel=”bookmark”
    title=”Permanent Link to <?php the_title_attribute(); ?>”>
    <?php the_title(); ?>

    </h3>`

    It should be more like this, don’t really know what was there before so I can’t know if that’s the problem…:

    <h3
    rel="bookmark"
    title="Permanent Link to <?php the_title_attribute(); ?>">
    <?php the_title(); ?>
    
    </h3>
    Thread Starter MCWebdesign

    (@mcwebdesign)

    Thanks very much, I had a couple of extra spaces in the end, but all looking good now!

    Matt

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error but can’t figure why!’ is closed to new replies.