• Hey,

    I have a problem.
    I am doing unique template and I have encountered this error.
    My page is now blank, and I don’t understand why. I believe it’s the closing <body> and <html> tags problem.

    <!--Header.php file-->
    <!DOCTYPE html>
    <html <?php language_attributes();?>>
        <head>
            <meta charset="<?php blog_info('charset');?>">
            <meta name="viewport" content="width=device-width">
            <title><?php blog_info('name');?></title>
            <?php wp_head();?>
        </head>
    
    <body <?php body_class();?>>
    
    	<div class="container">
            <header class="site-header">
                <h1><a href"<?php echo home_url();?>"><?php bloginfo('name');?></a></h1>
                <h5><?php bloginfo('description');?></h5>
            </header>
    <!--Footer.php file-->
    <footer class="site-footer">
    	<p><?php bloginfo('name');?> - &copy; <?php echo date('Y')?></p>
    </footer>
    
    <?php wp_head();?>
    </div> <!-- closing div container -->
    </body>
    </html>
    <!--index.php file-->
    <h1>Hello world!</h1>
    
    <?php
    
    get_header();
    
    if (have_posts()):
    	while (have_posts()) : the_post();?>
    
        <article class="post">
            <h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
            <?php the_content();?>
        </article>
    
    <?php endwhile;
    
    	else :
    	echo '<p>No content found</p>';
    
    endif;
    
    get_footer();
    
    ?>

    I tried deleting everything in header.php file and footer.php file, then suddenly it worked, but when I add something in these files I have blank page error. Can anyone provide me with solution? Would be thankful. <3

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Blank page error’ is closed to new replies.