SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2012
    Location
    Drobeta-Turnu Severin, Mehedinti, Romania, Romania
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation I get error in my code, please help, unexpected 'endwhile' !

    Parse error: syntax error, unexpected 'endwhile' (T_ENDWHILE) in index.php on line 61
    PHP Code:
    <?php
    global $options;
    foreach (
    $options as $value) {
    if (
    get_settings$value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings$value['id'] ); }
    }
    ?>
    <?php get_header
    (); ?>
    <div id="slider">
    <img src="<?php bloginfo('template_url');?>/images/slider/1.jpg" alt="" />
    <img src="<?php bloginfo('template_url');?>/images/slider/2.jpg" alt="" />
    <img src="<?php bloginfo('template_url');?>/images/slider/3.png" alt="" />
    </div>
    <div id="wrap">
        <div id="main">
                    <?php if (have_posts()) : ?>
            <?php while (have_posts()) : the_post(); 
            
    $thumbnail wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
            
    ?>
                <div class="poster">
                    <div class="leftside">
                        <div class="inline-byline">
                            <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="date-num"><?php the_time('j'?></a>
                            <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="date-month"><?php the_time('M'?></a>
                            <span>Autor/span> <span class="inline-byline-author"><?php the_author_posts_link(); ?></span>
                            <span class="comment"><?php comments_popup_link('0''1''%'); ?></span>
                         </div>
                    </div>
                            
                <div class="post postcontent">
                <?
                
    // checks if thumbnails are disabled
                
    if ($xs_disable_thumbnails_archieve == "true") { ?>
              <? } else { ?>
                    <?php
                        
    if ( has_post_thumbnail() ) { 
                        
    // the current post has a thumbnail
                        
    ?>
                        <div class="thumbnail-wrap">
                            <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo $thumbnail[0]; ?>" height="270" width="560" alt="<?php the_title(); ?>" class="thumbnail" /></a>
                        </div><!-- /thumbnail-wrap -->
                        <? } else { 
                        
    // the current post lacks a thumbnail
                        
    ?>
                    <? ?>
                <? ?>
                <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
                <?
                
    // checks if the byline is disabled
                
    if ($xs_disable_inline_byline == "true") { ?>
                <?
                
    // if not show byline
                 
    } else { ?>
                
                <? ?>
            <?php the_excerpt(); ?>
            
                    </div><!-- /post postcontent -->
                    <div class="clear"></div>
                    </div>
                    
    <?php endwhile; ?> // <-- I get Error here
    <?php endif; ?>
            <?php
                
    //Check For the Page Navi Plugin
                
    if (function_exists('wp_pagenavi')) {
                       
    wp_pagenavi();
                
    //Show Default Navigation if Page Navi Is Not Installed
                
    } else { ?>
                       <div id="paginate">
                        <div id="paginate-left"><?php previous_posts_link('Newer Posts'?></div>
                        <div id="paginate-right"><?php next_posts_link('Older Posts'?></div>
                    </div><!-- /paginate -->
                <? ?>
    </div><!-- End Main -->        
    <?php get_sidebar(); ?>    
    <?php get_footer(); ?>
    Last edited by spikeZ; Aug 6, 2012 at 02:08. Reason: added [php][/php] tags

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    PHP Code:
     <?php while (have_posts()) : the_post();
    That line looks to be the problem, ending the while loop...

    Try something like:

    PHP Code:
    // stick to the "alternative syntax" for your while loop...
    <?php while (have_posts()) : ?>
    <?php
    the_post
    (); 
    // .. carry on

  3. #3
    SitePoint Member
    Join Date
    Aug 2012
    Location
    Drobeta-Turnu Severin, Mehedinti, Romania, Romania
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i still get the same error.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •