WordPress.org

Ready to get started?Download WordPress

Forums

Last problem for final upgrade.. (4 posts)

  1. john1000
    Member
    Posted 9 years ago #

    Ok im almost done and taken parts of my old index.php and putting them into the
    wp-header
    wp-footer and the sidebar.
    but the last piece of code..this part should go into the div id content in wp-header..

    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <?php time_of_day($post->ID);?>
    <?php the_date('','<h2>','</h2>'); ?>
    <div class="post">
    <h3 class="storytitle" id="post-<?php the_ID(); ?>">" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></h3>
    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>
    <?php getPostTimes(); ?>
    <div class="storycontent">
    <?php the_content(); ?>
    </div>
    <div class="feedback">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    </div>
    <!--
    <?php trackback_rdf(); ?>
    -->
    <?php include(ABSPATH . 'wp-comments.php'); ?>
    </div>
    <?php endforeach; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>

    Well it simple causes this error..
    parse error, unexpected $ in /home/public_html/myblog/wp-header.php on line 133
    a
    and line 133 is
    <?php endif; ?>

    so why is that ,all is done ok and no mistakes ,....i think...

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Use this:
    <?php
    /* Don't remove this line. */
    require('./wp-blog-header.php');
    include(ABSPATH . '/wp-header.php');
    ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php the_date('','<h2>','</h2>'); ?>
    <div class="post">
    <h3 class="storytitle" id="post-<?php the_ID(); ?>">" rel="bookmark"><?php the_title(); ?></h3>
    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
    <?php getPostTimes(); ?>
    <div class="storycontent">
    <?php the_content(__('(more...)')); ?>
    </div>
    <div class="feedback">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    </div>
    <!--
    <?php trackback_rdf(); ?>
    -->
    </div>
    <?php comments_template(); // Get wp-comments.php template ?>
    <?php endwhile; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>
    <?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
    <?php include(ABSPATH . '/wp-footer.php'); ?>

    That is default 1.3 code, with your posttimes line added.

  3. john1000
    Member
    Posted 9 years ago #

    well thanks podz but this isnt compatible...
    if i put in the code as you posted i get complete double pages with double menue's.
    so that cannot be what you had in mind...
    why does it produce the parse error ?

  4. john1000
    Member
    Posted 9 years ago #

    any one ?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.