0

I am building my own wordpress theme. I'm not new to the html and pages related stuff but never did line of coding for php. I wanted to move on more complex cms - wordpress. Now I cant see why but my page throws out parsing errors for some reason.

Parse error: syntax error, unexpected ... on line ##

Here is part of my code including html in php:

     <?php

     if (have_posts()) :
        while (have_posts()) : the_post();

        <h2>Title here</h2> /* says error is on this line */

        endwhile;

        else :
            echo '<p>No content found</p>'

        endif; /* also error is on this line */

     ?>

I'm using dreamweaver but that’s not key for solving this I guess.

serenesat
  • 4,611
  • 10
  • 37
  • 53
Lucián Blažek
  • 49
  • 1
  • 1
  • 7

2 Answers2

-1

Try this. One echo and Semi colon was missing.

if (have_posts()) :
    while (have_posts()) : the_post();

    echo '<h2>Title here</h2>'; /* says error is on this line */

    endwhile;

    else :
        echo '<p>No content found</p>';

    endif; /* also error is on this line */
Sanjay Kumar N S
  • 4,653
  • 4
  • 23
  • 38
-1
<?php

     if (have_posts()) :
        while (have_posts()) : the_post();
?>
        <h2>Title here</h2> /* says error is on this line */
<?php
        endwhile;

        else :
            echo '<p>No content found</p>'

        endif; /* also error is on this line */

     ?>

This will help you....

Vignesh Bala
  • 889
  • 6
  • 25