• Hi there! Even though I’m not “new” with wordpress, this is the first time I try to modify a theme. So far I could manage to make some codes work, but when I mix them thogheter I got syntax errors.

    This is the situation:
    I wanted to show a list of post of the category before the content of the “active” post itself; so I searched in the forum for a code wich would let me do that.
    Once I found it I manage to make it work while showing the post, but when I add all the rest of the code (wich includes the comments and the pagenav – starts in the div “postmeta”) I get those syntax errors!
    Please, if somebody can help me out it would be really appreaciated!

    Here is the code of “single.php”:

    <?php get_header(); ?>
    
    <div id="singContent">
    
    <?php
    global $post;
    $categories = get_the_category();
    $category = $categories[0];
    $cat_ID = $category->cat_ID;
    
    $myposts = get_posts("numberposts=0&category=$cat_ID&order=ASC&orderby=date");
    ?>
    <ul class="sing">
    <?php foreach($myposts as $post) :?>
    <li class= "sing">
    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>
    </div>
    
    <div id="coreContent">
    <?php the_post() ?>
     <div class="post single hentry">
            <div class="postContent">
    
              <div class="entry-content">
                  <?php the_content(); ?>
              </div>
            </div>
            <div class="postMeta">
              <?php
              $arc_year = get_the_time('Y');
              $arc_month = get_the_time('m');
              $arc_day = get_the_time('d');
              ?>
    
              <div class="postDate"><span>Published:</span> <abbr class="published" 
    
    title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><a href="<?php echo 
    
    get_day_link("$arc_year", "$arc_month",
              "$arc_day"); ?>"><?php the_time('F j, Y'); ?></a></abbr></div>
            	<div class="categories"><span>Filed Under:</span> <?php 
    
    the_category(', '); ?></div>
            	<?php the_tags('<span>Tags:</span> ', ' : ', ''); ?>
            </div>
    	  </div>
    
            <div class="postMeta">
    
            <?php if ('closed' == $post->comment_status) : ?>
    
              <div class="comments closed">
    
             	<?php else : ?>
    
              <div class="comments">
    
              <?php endif; ?>
    
                <?php comments_popup_link('leave a comment', '1 comment', '% comments', 
    
    '', 'comments closed'); ?>
              </div>
            </div>
          </div>
    
    		<?php endwhile; ?>
    
        <div class="pageNav">
          <div class="prev"><?php next_posts_link('< Older Posts') ?></div>
          <div class="next"><?php previous_posts_link('Newer Posts >') ?></div>
        </div>
    
    	<?php else : ?>
    
    		<h2>Not Found</h2>
    		<p>Sorry, but you are looking for something that isn't here.</p>
    
    	<?php endif; ?>
    
      </div>
    
    <?php get_footer(); ?>

  • The topic ‘Syntax error’ is closed to new replies.