The MU forums have moved to WordPress.org

Need a bit of help with my code (1 post)

  1. peiqinglong
    Member
    Posted 16 years ago #

    So I'm using this code on my company intranet, and I got it mostly right, except everything after the last PHP code doesn't load. So something is causing a choke in my syntax, but I can't figure it out. Any help is greatly appreciated!

    <?php // GETS THE LATEST FEATURE ARTICLE FIRST
    $my_query = new WP_Query('category_name=Featured&showposts=1'); while ($my_query->have_posts()) : $my_query->the_post();
    $do_not_duplicate = $post->ID;
    
    // CHECKS TO SEE IF THERE'S AN IMAGE FOR THIS POST
    $featured_pic = get_post_meta($post->ID, 'Featured Pic', $single = true);
    
    // CHECKS TO SEE IF THERE'S A SET ALT TEXT FOR THIS IMAGE
    $featured_pic_description = get_post_meta($post->ID, 'Featured Pic Excerpt', $single = true); ?>
    
    <div id="featuredpost">
    
    A bunch of featured post code				
    
    </div><!-- featuredpost -->
    
    <?php endwhile; ?>
    
    <div id="non-featured-container">
    
    <h2 id="non-featured-banner">Latest Articles</h2>
    
    <?php // THE SECOND LOOP SHOWING THE ARTICLES AFTER THE FEATURE
    
    if (have_posts()) : $i = 1; while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts);
    
    // CHECKS TO SEE IF THERE'S AN IMAGE FOR THIS POST
    $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true); ?>
    
    <?php include (TEMPLATEPATH . '/latest-site-news.php'); ?>
    <?php if($all_posts = ah_recent_posts_mu_mod(WPMU_RSS_LIMIT, WPMU_RSS_CACHETIME)) : ?>
    <?php foreach($all_posts as $all_post): ?>
    
    <?php // for controlling the layout of the home pages bottom excerpts up to 10 posts
    if($i == '1' || $i == '3' || $i == '5' || $i == '7' || $i == '9' || $i == '11' || $i == '13') { ?>
    
    <div class="post-container">
    
    <?php } // endif ?>
    								<div class="<?php if($i % 2 == 0) { echo 'post-right'; } else { echo 'post-left';} ?>">
    
    <div id="post-<?php the_ID(); ?>" class="post">
    								<h2><a>guid ?>"><?php echo htmlspecialchars($all_post->post_title) ?></a></h2>
    
    <div class="entry">
    
    <?php echo $all_post->post_summary ?>
    
    </div><!-- entry -->
    
    </div><!-- post -->
    
    </div><!-- post (left or right) -->
    
    <?php // for controlling the layout of the home pages bottom excerpts up to 10 posts
    
    if($i == '2' || $i == '4' || $i == '6' || $i == '8' || $i == '10' || $i == '12' || $i == '14') { ?>
    
    </div><!-- post-container -->
    
    <?php } // endif ?>
    
    <?php $i++; ?>
    
    <?php endforeach; endif; ?>
    
    <?php endwhile; endif; ?>
    
    </div><!-- non-featured-container -->

About this Topic

  • Started 16 years ago by peiqinglong