-2

I was trying to make a page so I put a post on a specific page on Wordpress and I ended up getting a syntax error. Below is the code I used.

 <?php /* Template Name: blog */
    global $more;
     $more = 0;
     query_posts('cat=29');
    if(have_posts()) : while(have_posts()) : the_post();
     ?>
    </p> 
    <p>
    <a href=&amp;quot;<?php the_permalink(); ?>&amp;quot;><?php the_title( '</p> <h3>', </h3> <p>' ); ?></a></p>
     <p>
    <?php endwhile;
    <endif;
    wp_reset_query(); 
    ?>

3 Answers3

0

A little indentation can help here (edited for brevity):

<?php
global $more;
$more = 0;
query_posts('cat=29');
?>
<?php if(have_posts()) :?>
    <?php while(have_posts()) : ?>
        <?php the_post(); ?>
        <a href="<?php the_permalink(); ?>">
            <?php the_title( '<h3>', '</h3>'); ?>
        </a>
    <?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query();
Progrock
  • 7,373
  • 1
  • 19
  • 25
0

Try this code:-

     <?php 
        /* Template Name: blog */
        global $more;
        $more = 0;
        query_posts('cat=29');
        if(have_posts()) : while(have_posts()) : the_post();
     ?>
     </p> 
     <p>
     <a href=&amp;quot;<?php the_permalink(); ?>&amp;quot;><?php the_title( '</p> <h3>, </h3> <p>' ); ?></a></p>
     <p>
     <?php 
         endwhile;
         endif;
         wp_reset_query(); 
     ?>
Rajkumar R
  • 1,097
  • 8
  • 14
-1

the_title( '</p> <h3>', </h3> <p>' ); should be the_title( '</p> <h3>', '</h3> <p>' );

<endif; is that right?