Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wordpress Theme Trouble: When I click a title I get a blank page.

Featured Replies

I tackled the massive theme tutorial here today:

http://www.wpdesigner.com/2007/02/19/so-you-want-to-create-wordpress-themes-huh/

 

And when I got to the end I realized that when I clicked on my post titles I'd get a blank white page. With the default theme, this doesn't happen.

 

D:

 

I'm doing this locally, by the way.

I'm pretty sure I've gotten all the page codes right. I copied them from the guy's just to make sure and it still doesn't work. The tutorial was written a while ago, and I'm very new to wp, so I wouldn't know if there've been changes in the theme-making process since.

 

If you can help me at all, that'd be great.

 

Here are the main codes:

 

header.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">

<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>

<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />	
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<?php wp_get_archives('type=monthly&format=link'); ?>
<?php //comments_popup_script(); // off by default ?>
<?php wp_head(); ?>
</head>
<body><div id="wrapper">

<div id="header">

<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
<?php bloginfo('description'); ?>

</div>

 

index.php

<?php get_header(); ?>

<div id="container">

<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>

	<div class="post" id="post-<?php the_ID(); ?>">

		<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>

		<div class="entry">

			<?php the_content(); ?>

			<p class="postmetadata">
<?php _e('Filed under:'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> <?php  the_author(); ?><br />
<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> <?php edit_post_link('Edit', ' | ', ''); ?>
			</p>

		</div>

	</div>

<?php endwhile; ?>

	<div class="navigation">
		<?php posts_nav_link(); ?>
	</div>

<?php else : ?>

	<div class="post">
		<h2><?php _e('Not Found'); ?></h2>
	</div>

<?php endif; ?>

</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

 

Sidebar.php:

<div class="sidebar">

<ul>

<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar() ) : else : ?>

<li id="search">
	<?php include(TEMPLATEPATH . '/searchform.php'); ?>
</li>

<li id="calendar"><h2><?php _e('Calendar'); ?></h2>
	<?php get_calendar(); ?>
</li>

<?php wp_list_pages('depth=3&title_li=<h2>Pages</h2>'); ?>

<li><h2><?php _e('Categories'); ?></h2>
	<ul>
		<?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
	</ul>
</li>

<li><h2><?php _e('Archives'); ?></h2>
	<ul>
		<?php wp_get_archives('type=monthly'); ?>
	</ul>
</li>

<?php get_links_list(); ?>

<li><h2><?php _e('Meta'); ?></h2>
	<ul>
		<?php wp_register(); ?>
		<li><?php wp_loginout(); ?></li>
		<?php wp_meta(); ?>
	</ul>
</li>

<?php endif; ?>

</ul>

</div>

 

Footer.php:

<div id="footer">
<p>
Copyright © 2007 <a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a>
</p>
</div>

</div></body>
</html>

 

There are other files as well, but it;d be a pain to post them all...

Funnily enough I use that exact tutorial to build my first WP site a few months back. I've had no problems with it so far though to be fair.

 

My container code is a little different to yours though... mainly the second line... could this be the culprit? I have no idea :lol: try copying & pasting mine in.

 

    <div id="container">
       <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
       <div class="post" id="post-<?php the_ID(); ?>">
          <h2><a href="<?php the_permalink();?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
           <div class="entry">
               <?php the_content();?>
               <p class="postmetadata">
                   <span class="postmeta">
               <?php _e('Filed under:'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> <?php  the_author(); ?><br />
               <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> <?php edit_post_link('Edit', ' | ', ''); ?>
                   </span>
               </p>
           </div>
       </div>            
       <?php endwhile; ?>
           <div class="navigation">
               <?php posts_nav_link('in between','before','after'); ?>
           </div>
       <?php else : ?>
           <div class="post">
               <?php _e('Not Found'); ?>
           </div>
       <?php endif; ?>
   </div>


<?php get_sidebar(); ?>

<?php get_footer(); ?>

 

Check the permalink settings for each post, and also in the 'settings>permalinks' bit aswell and make sure they are all good.

 

Hope it helps,

If not then hopefully some WP whiz-kid can spot the problem ^_^

  • Author

I tried your code (with the get_header thing at top though) and the problem persisted. There doesn't seem to be anything wrong with the permalink settings either.

 

WP whiz-kids, descend!

If you chuck up an .rar or .zip of the theme I can have a play around on my local and see if I can spot the problem.

 

Other than that, I can't really see why it's not working properly :huh:

 

P.S. liking your Ravenflight photomanip. :p

  • Author

Thats a good idea. Go here:

guildlist.zxq.net/tutorial.zip

 

Thanks. ^^

 

EDIT:

I figured it out! I had an uploaded version of the theme and when I clicked a title it gaze me an error about something wrong with the single.php page on line 29. I wasn't sure what was wrong with the line, so I copied and pasted the index.php back into the single.php file as the tutorial instructed, just to make sure I'd gotten it right. Then I saved it and the thing worked. :D

 

Huzzah!

 

Thanks for the help anyway *attempts to see if your name is Jack and fails* Jacksaidwhat! You'd probably have figured it out if I hadn't gotten lucky. x)

I didn't think it was one of the codes you'd posted, because all but line 2 in the index container were basically identical to mine.

 

Glad you got it sorted though… and yes my name is Jack, Haha.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.