• Resolved NVM

    (@nvm-1)


    Hi!
    It’s my first post here and I’m totally newbie in making WordPress themes.
    At the start I tried make a very simple site based on WordPress, but I have a problem with blank pages – yes, all pages are blank and i can’t undestand what I missed or what I did wrong way. It means that on every page there are neither menu nor footer.

    My PHP files structures in the theme folder:
    footer.php
    functions.php
    header.php
    index.php
    page.php
    style.css [I’ll style it later]

    Link: https://www.dobrotek.com.pl/test/

    Thanks for help in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • If your WP website is blank here’s some notes:

    • when developing a new theme, always make sure DEBUG is on in wp-config.php, this will print PHP errors and guide you to the line of the error(s).. if that doesn’t do anything, try adding error_reporting(E_ALL); ini_set('display_errors', 1); into wp-config.php it *should* also tell you if it’s an issue or conflict with a plugin
    • check the source code, see if there’s header and footer content, if there is the issue is with a index/page file, not footer/functions/header/etc.
    • if you’re able to log into /wp-admin/ and see things, it’s for sure a a PHP error

    (PS. I’ve had white-screens-of-death from upgrades too (corrupt file), so keep that in mind if you upgraded immediately prior to this issue).

    Thread Starter NVM

    (@nvm-1)

    @davidsword – thank you for reply!
    I didn’t know about Debugging in WordPress, thanks! The wp-admin works like a charm, and I found the cause of my troubles.

    In the page.php just add a condition to checking post (erm, I was confused, because I was sure posts are not the same as pages, but anyway…) and then get a content.

    For others:

    if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    		<article id="post-<?php the_ID(); ?>">
    		<?php if ( ! is_front_page() ) { ?>
    			<h2 class="entry-title"></h2>
    		<?php } ?>
    			<section class="entry-content">
    				<?php the_content(); ?>
    			</section><!-- .entry-content -->
    		</article>
     <?php endwhile; ?>

    and now all works fine. I just forgot about the Worpdress loop and wonder why it not works ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Blank pages’ is closed to new replies.