Support » Themes and Templates » Parse error: parse error, unexpected ‘:’

  • I installed wordpress and everything, and I’m using an iframe so I had to put the require wp-blogheader.php code at the top of the page. I saved the page as main.php, but I get this error:

    Parse error: parse error, unexpected ‘:’ in /home/gishers/public_html/wp-content/themes/default/main.php on line 3

    I know it’s from this code:
    <?phpwhile(have_posts()):the_post();?>

    I realize i have no spaces in the above code, before this i was getting about 5 errors, someone told me to take out all the spaces in my php codes and so i did and now I only have one error. The errors I get when the iframe page has all the appropriate spaces is:

    Warning: main(/home/gishers/public_html/wp-blogheader.php): failed to open stream: No such file or directory in /home/gishers/public_html/wp-content/themes/default/main.php on line 1

    Warning: main(/home/gishers/public_html/wp-blogheader.php): failed to open stream: No such file or directory in /home/gishers/public_html/wp-content/themes/default/main.php on line 1

    Fatal error: main(): Failed opening required ‘/home/gishers/public_html/wp-blogheader.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/gishers/public_html/wp-content/themes/default/main.php on line 1

    so i’m not sure what to do or how to fix this.. i’ve been trying to fix it for hours and no hope 🙁

    this is the code of my main.php (the iframe)
    code<?phprequire(“/home/gishers/public_html/wp-blogheader.php”);?>
    <?phpget_header();?>
    <?phpif(have_posts()) :?>

    <?phpwhile(have_posts()):the_post();?>

    <div class=”post” id=”post-<?phpthe_ID();?>”>
    <h2>” rel=”bookmark” title=”Permanent Link to <?phpthe_title();?>”><?phpthe_title();?></h2>
    <small><?phpthe_time(‘F jS, Y’)?> <!– by <?phpthe_author()?> –></small>

    <div class=”entry”>
    <?phpthe_content(‘Read the rest of this entry »’);?>
    </div>

    <p class=”postmetadata”>Posted in <?phpthe_category(‘, ‘)?> | <?php edit_post_link(‘Edit’,”,’|‘);?> <?phpcomments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’);?>
    </div>

    <?phpendwhile;?>

    <div class=”navigation”>
    <div class=”alignleft”><?phpnext_posts_link(‘« Previous Entries’)?></div>
    <div class=”alignright”><?phpprevious_posts_link(‘Next Entries »’)?></div>
    </div>

    <?phpelse :?>

    <h2 class=”center”>Not Found</h2>
    <p class=”center”>Sorry, but you are looking for something that isn’t here.
    <?phpinclude (TEMPLATEPATH . “/searchform.php”);?>

    <?phpendif;?><?phpget_footer();?> /code

Viewing 6 replies - 1 through 6 (of 6 total)
  • <?phpwhile(have_posts());the_post();?>

    ; not : in the middle.

    now i get this:

    Fatal error: Call to undefined function: phprequire() in /home/gishers/public_html/wp-content/themes/default/main.php on line 1

    <?php require

    Note the space.

    I realize that, however, when i put that I get this (like i stated in the first post)

    Warning: main(/home/gishers/public_html/wp-blogheader.php): failed to open stream: No such file or directory in /home/gishers/public_html/wp-content/themes/default/main.php on line 1

    Warning: main(/home/gishers/public_html/wp-blogheader.php): failed to open stream: No such file or directory in /home/gishers/public_html/wp-content/themes/default/main.php on line 1

    Fatal error: main(): Failed opening required ‘/home/gishers/public_html/wp-blogheader.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/gishers/public_html/wp-content/themes/default/main.php on line 1

    wp-blogheader.php is not a wp file
    wp-blog-header.php is.

    thank you doll 🙂 How could I be so silly?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Parse error: parse error, unexpected ‘:’’ is closed to new replies.