source is correct, but page is blank
-
I have customized an existing theme and installed it.
Now, even though the source code of the index page seems to be correctly pulling all the information, it is rendering as a blank white page.
https://adamoverett.com/wordpress/
Other themes work fine (including the one I copied and altered to create my own theme).
Any thoughts?…Please help.
Thanks!
-
did you name it correctly in the theme’s
style.css
? except with a different name?Making some progress…
Turns out there were some problems in the header.php file.
At least the page isn’t blank anymore, but I’m still working a lot of bugs out.
Feedback appreciated.
Okay…I’ve got most of it working, but can someone help?
Whenever I click on a recent item at the top or “Older Entries” or do a search, it returns the same page. It doesn’t go to the single entry format or list the actual entries containing keywords from the search. Can’t even get to older entries.
https://adamoverett.com/wordpress/
What am I doing wrong?
(As a side note: The theme which I modified to create this theme works fine. Shows single entry format when an item is clicked…returns correct result when a search is performed.)
Whenever I click on a recent item at the top or “Older Entries” or do a search, it returns the same page.
Oh no it doesn’t. It just looks like the same page. Check out the headings on the page that displays following the click on a single post/item. The headings aren’t links anymore and looking at the nav menu, the blog “thinks” it’s now displaying the home page. So WP is using another template file (presumably single.php) which just so happens to look very similar to your front page. So that problem would appear to be in single.php. Might be worth grabbing a copy of the same file in the original theme and re-building/customising it.
I suspect the search listing issue is down to a similar problem but I couldn’t test it as the search isn’t currently usable. You have quite a few validation errors on the home page – 1 or more of which may be causing a problem with the search input. I’d suggest you try to get rid of as many of these errors as you first before going much further.
Thank you so much for your input, esmi! I appreciate the help! ??
So WP is using another template file (presumably single.php) which just so happens to look very similar to your front page. So that problem would appear to be in single.php. Might be worth grabbing a copy of the same file in the original theme and re-building/customising it.
I have copied over the single.php file from the original theme (I had actually done this before), and the only thing I’ve added to it is a
<div id="wp">
wrapper to position it, but it still displays all the same posts no matter what I click on or search for.I suspect the search listing issue is down to a similar problem but I couldn’t test it as the search isn’t currently usable.
I’m not sure what you mean it’s not usable. I am able to search…Just not get the correct results with the search…Only the same 7 posts every time. Grrrrrr…
You have quite a few validation errors on the home page – 1 or more of which may be causing a problem with the search input. I’d suggest you try to get rid of as many of these errors as you first before going much further.
I fixed all of the errors, mostly by switching the DOCTYPE to HTML 4.01 Transitional instead of XHTML 1.0 Transitional. Does the DOCTYPE have to be XHTML?
Can someone please help? I’ve been over and over the code, and I cannot figure it out!
UPDATE: After doing more research on WP, I have made the DOCTYPE XHTML 1.0 Transitional (as well as the rest of the code), and now the page passes the validator with no errors and no warnings.
Still, even though the page title changes to whichever permalink is clicked, the content on the page does not change. And the search field returns the same 7 posts every time. Also…if you click “Older Entries” or “Newer Entries”…same 7 posts.
AAAARRRRRRGGGGGGHHHH!…HELP!
UPDATE: Okay! I have it isolated to the bit of code I’m using to call the most recent posts:
<div id="recent"> <img src="https://adamoverett.com/IMAGES/recent.jpg" alt="recent highlights" /> <?php query_posts('showposts=7'); ?> <ul class="recent-posts"> <?php while (have_posts()) : the_post(); ?> <li><a title="<?php _e('Permanent link to'); ?> <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li> <?php endwhile;?> </ul> </div> <!--/recent -->
When I take that code out, the page works as it’s supposed to. So what’s wrong with the code? I’m trying to show the titles of the 7 most recent posts.
If you’re using that code snippet and another Loop on the same page, you may want to do some reading up on Multiple Loops.
Ahhh…Thanks, esmi! I still haven’t figured it out, but let me see if I understand…
On the theme that I modified, there’s the main loop in the index.php that calls the blog posts, and in the footer.php is a list that calls the 5 most recent post titles. I moved that recent post code into the header.php section and have it calling the 7 most recent post titles. But now since that appears first on the page, the second loop in the index.php is calling those exact same 7 posts…Is that correct?
I’m still trying to figure it out from the article you mention, but am I able to have the 7 most recent posts list appear before the main post loop?
Here’s the code in the header.php for the recent post titles:
<div id="recent"> <img src="https://adamoverett.com/IMAGES/recent.jpg" alt="recent highlights" /> <?php query_posts('showposts=7'); ?> <ul class="recent-posts"> <?php while (have_posts()) : the_post(); ?> <li><a title="<?php _e('Permanent link to'); ?> <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li> <?php endwhile;?> </ul> </div> <!--/recent -->
And here’s the code from the main loop in the index.php:
<?php get_header(); ?> <div id="wp"> <div id="content"> <?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?> <div class="post"> <div class="post-date"> <span class="post-month"><?php the_time('M') ?></span><span class="post-day"><?php the_time('j') ?></span></div> <div class="post-title"> <h2><a title="Permanent Link to <?php the_title_attribute(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2> <span class="post-cat">Posted in <?php the_category(', ') ?></span></div> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?></div> </div> <?php endwhile; ?> <div class="navigation"> <span class="previous-entries"><?php next_posts_link('Older Entries') ?></span><span class="next-entries"><?php previous_posts_link('Newer Entries') ?></span></div> <?php else : ?> <h2>Not Found</h2> <p>Sorry, but you are looking for something that isn't here.</p> <?php endif; ?></div> <!--/content --> <?php get_sidebar(); ?> </div> <!--/wp --> <?php get_footer(); ?>
If you have any idea how to tweak the code in the index.php section to not call the same 7 posts, would you let me know?
Thanks so much! ??
I GOT IT! ??
I found this piece of code to use instead to call my 7 recent post titles:
<div id="recent"> <img src="https://adamoverett.com/IMAGES/recent.jpg" alt="recent highlights" /> <ul> <?php $recentPosts = new WP_Query(); $recentPosts->query('showposts=7'); ?> <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> </div> <!--/recent -->
It seems to be working correctly now! Thanks, esmi, for putting me on the right track! I really appreciate it!! ??
- The topic ‘source is correct, but page is blank’ is closed to new replies.