0

I get this message, whenever I activate this page template for one page, for instance about.php :

Parse error: syntax error, unexpected end of file in /home/u425744603/public_html/wp-content/themes/helle/page-notime.php on line 1

There is no error! This is actually the same template I've been using for a few weeks and it worked perfectly fine.

This is the code for the template:

<?php
/* Template Name: Page Without Time */
?>
<?php get_header(); ?>

<div id="container">

    <div id="columns">
        <div class="col-9">

    <div id="content">
        <?php /* Top post navigation */ ?>
            <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?>
                <div id="nav-above" class="navigation">
                    <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&laquo;</span> Older posts', 'your-theme' )) ?></div>
                    <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&raquo;</span>', 'your-theme' )) ?></div>
                </div><!-- #nav-above -->
            <?php } ?>

        <?php
            if ( have_posts() ) {
                $post = $posts[0]; $c=0;
                while ( have_posts() ) {
                    the_post();

                $c++;

                if ( $c == count( $posts ) ) { ?>
                <h1><?php the_title(); ?></h1>

                <p><?php the_content(); ?></p>
                <?php get_template_part( 'content', get_post_format() ); ?>
                <div style="width: 100%; border:none;"></div>
                <?php
                }

                else { ?>
                <h1><?php the_title(); ?></h1>

                <p><?php the_content(); ?></p>
                <?php get_template_part( 'content', get_post_format() ); ?>
                <div style="width: 100%; border-bottom: 1px solid #000;"></div>

                <?php
                    }
                } // end while
            } // end if
        ?>

        <?php /* Bottom post navigation */ ?>
            <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?>
                <div id="nav-below" class="navigation">
                    <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&laquo;</span> Older posts', 'your-theme' )) ?></div>
                    <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&raquo;</span>', 'your-theme' )) ?></div>
                </div><!-- #nav-below -->
            <?php } ?>
    </div><!-- #content -->

    </div>
        <div class="col-3 grey">
            <p>Hoi</p>
        </div>
    </div>

</div><!-- #container -->

<div id="primary" class="widget-area">
</div><!-- #primary .widget-area -->

<div id="secondary" class="widget-area">
</div><!-- #secondary -->

<?php get_sidebar(); ?>

<?php get_footer(); ?>

I would really appreciate it if someone can tell me why I get this error in all of a sudden.

  • Maybe your FTP program has removed the line-breaks during upload? See stackoverflow.com/questions/28163344/… – fuxia Mar 5 '16 at 13:06
  • @toscho Thanks a lot! Do you know why FileZilla for instance removes line-breaks ? – user3024879 Mar 5 '16 at 13:34
  • @toscho place it as an answer so I can state it's solved – user3024879 Mar 5 '16 at 13:38
  • Not sure if this has anything to do with it but I know that when you download from a Linux server FileZilla adds double line brakes unless download mode is set to binary. Maybe this is something similar? – yobddigi Mar 5 '16 at 17:12
  • no problem. My pleasure. – yobddigi Mar 5 '16 at 17:23
0

Maybe your FTP program has removed line-brakes burring upload. See https://stackoverflow.com/questions/28163344/parse-error-syntax-error-unexpected-end-on-line-1

toscho feel free to post your comment as an answer. I just thought I would do it so this thread could be marked as answered

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.