Can you use the pastebin so I can view your code.
Are you missing a semi-colon on line 19?
I haven’t made a change to 19, as far as I’m aware. I’m happy to try inserting a semi-colon, but I’m not sure where to place it…
Any other suggestions?
Try changing line 19 from:
<h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title() ?></a></h2>
to:
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title() ?></a></h2>
Also what does the syntax error say?
Hi , and thanks for your help. The semi colon is now in place, but there has been no change to the original problem unfortunately.
Parse error: syntax error, unexpected T_ELSE in /home/content/d/o/u/douglasbell/html/Chariots/wp-content/themes/gridfocus/index.php on line 25
Also add a semi-colon after ‘the_title()’ on line 25 just for completion.
I see your problem now, your code is structured in the following way:
if
while
endwhile
else
endif
Your problem is because there is no opening if. This might have been missed off when copying/pasting code?
Hi,
do you mean another semi-colon on line 19? (as below)
<h2>” title=”<?php the_title(); ?>”><?php the_title(); ?></h2>
I’m not sure how an opening ‘if’ has gone missing – having been very careful with pasting, and unfortunately I’m not sure how to replace it exactly…
Many thanks again for your help…!
I’ve spotted where the missing IF was… here is the original code from the top of the Index.php – I’m stuck on how to fix this still, so any help would be hugely appreciated. Learning by doing.
<div id="filler" class="fix">
<div id="mainColumn">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" class="post">
<div class="postMeta">
<p class="container">
</p>
</div>
[Please post code snippets between backticks or use the code button.]
Try adding:
<?php if (have_posts()) : ?>
directly under the line:
<?php query_posts('category=1'); ?>
Thanks David.
It seems to have resulted in a new error:
Parse error: syntax error, unexpected $end in /home/content/d/o/u/douglasbell/html/Chariots/wp-content/themes/gridfocus/index.php on line 46
Any thoughts?
Could you put the whole files updated code on pastebin?
Inndex.php as it is now http://pastebin.com/SeLWVrpU, resulting in:
Parse error: syntax error, unexpected $end in /home/content/d/o/u/douglasbell/html/Chariots/wp-content/themes/gridfocus/index.php on line 46
There is now no matching `endif;’ directly before the line:
<div id="paginateIndex" class="fix">
This was present before.