WordPress.org

Ready to get started?Download WordPress

Forums

Template Problem (4 posts)

  1. dada78
    Member
    Posted 9 years ago #

    I am really new to this BUT always eager to learn.

    I have designed my own template and uploaded the theme + styles + images to my themes folder. I successfully selected the theme in my wordpress control panel but then I got the following error:

    Parse error: parse error, unexpected T_ENDWHILE in /home/bionicno/public_html/WordPress/wp-content/themes/bionicnomad-hip/index.php on line 57

    my themes folder structure looks like this:

    ./bionicnomad-hip
    - style.css
    - index.php
    - comments.php
    - ./images
    - all my images

    I am not very knowledgable with php and just followed a tutorial on how to make your own theme. I really hope that somebody can help me out here ( or I am going to get gray hair over this...)

    My code in index.php is as follows:

    <!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" xml:lang="en" lang="en">
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title>

    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <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 wp_head(); ?>
    </head>

    <body>
    <!-- Begin wrapper -->
    <div id="wrapper">
    <div id="container">
    <div id="blog-header"><div id="logo"><h1>BlogURL</h1>
    <div id="description">here goes the description </div>
    </div>
    </div>
    <!-- Begin navigation -->
    <div id="navigation">
    <div class="navi-padding">

    </div>
    </div>
    <!-- End navigation -->

    <!-- Begin content -->

    <!-- Begin main column -->
    <div id="main">

    <div id="date-header">Here goes date</div>

    <!-- Begin .post -->
    <div class="post" id="post-<?php the_ID(); ?>">
    <h3 class="post-title">" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h3>
    <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>

    <div class="post-body">
    <?php the_content('Read the rest of this entry »'); ?></div>

    <div class="post-footer">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit','','|'); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></div>

    <?php comments_template(); ?>
    <?php endwhile; ?>

    <p align="center"><?php next_posts_link('« Previous Entries') ?>   <?php previous_posts_link('Next Entries »') ?>

    <?php else : ?>
    <h2 align="center">Not Found</h2>
    <p align="center">Sorry, but you are looking for something that isn't here.
    <?php endif; ?>

    </div>

    <!-- End .post -->

    <!-- Begin #comments -->

    <div id="comments">comments</div>
    </div>
    <!-- End #comments -->

    <!-- End main column -->

    <div id="sidebar">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="300">
    <param name="movie" value="../Slideshow/slideshow_ecotop.swf" />
    <param name="quality" value="high" />
    <embed src="../Slideshow/slideshow_ecotop.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="300"></embed></object>
    <!-- START META -->
    <li id="meta"><h2><?php _e('Meta:'); ?></h2>

    <!-- END META -->

    <div class="flash-bgr"><div class="flash-banner">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="180" height="150">
    <param name="movie" value="http://www.hellocoolworld.com/banners/corp_180x150_loop.swf" />
    <param name="quality" value="high" /><embed src="http://www.hellocoolworld.com/banners/corp_180x150_loop.swf" width="180" height="150" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>
    </div>
    </div>

    <!-- START LINKS LIST -->
    <?php get_links_list(); ?>
    <!-- END LINKS LIST -->

    <ul id="recently">test

    <h2 class="sidebar-title">Archives</h2>
    <ul class="archive-list">

  2. archives
  3. <!--
    This is a paragraph of text that could go in the sidebar.
    -->
    <!-- End sidebar -->
    </div>
    <!-- End content -->

    <div id="footer">
    <?php do_action('wp_footer'); ?>
    </div>
    </div>
    </div>
    <!-- End wrapper -->
    </body>
    </html>

  • moshu
    Member
    Posted 9 years ago #

    Please, don't post long code here; use http://pastebin.com

  • Michael Bishop

    Posted 9 years ago #

    I'll echo moshu, just pasting line 57, the source of the error, would have sufficed. As it is, the way you have pasted the index, we have no way of knowing what in on line 57.

    Check for an extra character, or a missing character. My experience, that's the case, you forget a " or ?> to a tag.

  • Teli
    Member
    Posted 9 years ago #

    Just taking a quick glance at your code, it appears that you forgot to actually start your WP loop...i.e. under the <div id="main">

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

    and see if that corrects the problem.

    P.S. I'm with moshu and miklb on the long bits of code...I make no guarantees on whether the above is the necessary fix simply because I didn't comb through your code ;)

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags