user1398067
user1398067

Reputation: 5

Wordpress PHP: Unexpected $End Error

This is both my first time messing with a Wordpress Template and my first time using PHP (save for the occasional server include). Which is to say, I no nothing of PHP and only barely have a grasp on the syntax.

I'm trying to create some customized loops and once I got one to work, I simply copy pasted the working code, changed the ID's, and expected that to work. Silly maybe? Anyhow, I'm getting an unexpected $end on line 203.

Anyone willing to tell me what's causing that? Thanks in advance!

<!-- FEATURED LOOP -->
<div class="featured">
<?php $my_query = new WP_Query('category_name=featured&showposts=1'); ?>
<?php if ( have_posts() ) : ?>
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>

        <?php do_atomic( 'before_entry' ); // origin_before_entry ?>

        <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
            <?php do_atomic( 'open_entry' ); // origin_open_entry ?>

            <?php
            if ( current_theme_supports( 'get-the-image' ) ) {                              
                if ( is_sticky ( $post->ID ) ) {
                    get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'single-thumbnail', 'image_class' => 'featured' ) );
                } else {
                    get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'thumbnail', 'image_class' => 'featured' ) );
                }
            }
            ?>

            <div class="sticky-header">
                <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
                <?php echo apply_atomic_shortcode( 'byline', '<div class="byline">' . __( '[entry-published] &middot; by [entry-author] &middot; in [entry-terms taxonomy="category" before=""] [entry-edit-link before=" &middot; "]', 'origin' ) . '</div>' ); ?>                 
            </div><!-- .sticky-header -->

            <div class="entry-summary">
                <?php the_excerpt(); ?>
                <?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', 'origin' ), 'after' => '</p>' ) ); ?>
            </div><!-- .entry-summary -->

            <?php do_atomic( 'close_entry' ); // origin_close_entry ?>
        </div><!-- .hentry -->

        <?php do_atomic( 'after_entry' ); // origin_after_entry ?>

    <?php endwhile; ?>
    <?php wp_reset_postdata(); // reset the query ?>
<?php else : ?>
<!--END FEATURED LOOP-->    

<!-- SUBFEATURED LOOP -->
<div class="subfeatured">
<?php $my_query = new WP_Query('category_name=subfeatured&showposts=1'); ?>
<?php if ( have_posts() ) : ?>
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>

        <?php do_atomic( 'before_entry' ); // origin_before_entry ?>

        <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
            <?php do_atomic( 'open_entry' ); // origin_open_entry ?>

            <?php
                if ( current_theme_supports( 'get-the-image' ) ) {
                    if ( is_sticky ( $post->ID ) ) {
                        get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'single-thumbnail', 'image_class' => 'featured' ) );
                    } else {
                        get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'thumbnail', 'image_class' => 'featured' ) );
                    }
                }
            ?>

            <div class="sticky-header">
                <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
                <?php echo apply_atomic_shortcode( 'byline', '<div class="byline">' . __( '[entry-published] &middot; by [entry-author] &middot; in [entry-terms taxonomy="category" before=""] [entry-edit-link before=" &middot; "]', 'origin' ) . '</div>' ); ?>
            </div><!-- .sticky-header -->

            <div class="entry-summary">
                <?php the_excerpt(); ?>
                <?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', 'origin' ), 'after' => '</p>' ) ); ?>
            </div><!-- .entry-summary -->

            <?php do_atomic( 'close_entry' ); // origin_close_entry ?>
        </div><!-- .hentry -->

        <?php do_atomic( 'after_entry' ); // origin_after_entry ?>

    <?php endwhile; ?>  
    <?php wp_reset_postdata(); // reset the query ?>
<?php else : ?>         
<!--END SUBFEATURED LOOP-->

Upvotes: 0

Views: 843

Answers (1)

Jage
Jage

Reputation: 8096

The last line of php code you have is:

   <?php else : ?>

You need to complete that control structure. You are missing something like:

   <?php endif; ?>

Upvotes: 2

Related Questions