php link to another page

im editing a wordpress theme for my own personal website. The page is for a blog, and what is meant to happen is that when you click on the ‘read more’ or blog title then it will open that blog in the seperate page to read. however when i click these 2 things i get the following message:

Server error The website encountered an error while retrieving
mywebsite/wordpress/?p=20. It may be down for maintenance or
configured incorrectly. Here are some suggestions: Reload this web
page later. HTTP Error 500 (Internal Server Error): An unexpected
condition was encountered while the server was attempting to fulfil
the request.

Read More

it was previously working before so i know the code that came with the theme worked. heres the code:

<div class="box">
<?php while ( have_posts() ) : the_post(); ?>
        <article>
            <h2><a href="<?php esc_url( the_permalink() ); ?>"<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
            <h7>BY LOUIS MOORE ON</h7> <time datetime="<?php the_time( 'Y-m-d' ); ?>" pubdate><?php the_date(); ?> <?php the_time(); ?></time><?php the_content(); ?>
<a href="<?php esc_url( the_permalink() ); ?>"/><h8>READ MORE</a></h8>  </br>   
</br><div class="h9"></div>
</article></br></br></br>
<?php endwhile; ?>

</div>

im not the gretest at php and i havent really changed it from its original form other than the things such as ‘read more’ ‘by louis moore’ the second div and the </br>

Related posts

Leave a Reply

1 comment

  1. There are several errors in the HTML code. Maybe that’s the problem.

    You may try this:

    <div class="box">
      <?php while ( have_posts() ) : the_post(); ?>
      <article>
        <h2><a href="<?php esc_url( the_permalink() ); ?>"> <?php the_title(); ?>" rel="bookmark"><?php the_title(); ?> </a></h2>
        <h7>BY LOUIS MOORE ON</h7>
        <time datetime="<?php the_time( 'Y-m-d' ); ?>"> pubdate><?php the_date(); ?> <?php the_time(); ?></time><?php the_content(); ?>
        <a href="<?php esc_url( the_permalink() ); ?>"> </a>
        <h8>READ MORE</a></h8>
        <br /><br />
        <div class="h9"></div>
      </article><br /><br /><br />
      <?php endwhile; ?>
    </div>