Hello,
I have been searching the codex/support forums and trying to resolve this for a week to no avail. I'm hoping a WP guru can get me on track and will be as detailed as possible. I ran a WP site a few years back but many things have changed and I'm just getting back into it.
I'm hosting a WP site on a server at my home:
- Server: LAMP configuration (Ubuntu 10.04 LTS).
- WP version: 3.4
- Theme: eDegree
- Plugins: Featured Content Gallery, Contact Form 7, NextGEN Gallery (all updated to latest versions)
My goal was to have summary posts on the main page displaying my 5 most recent posts, all set under the "Settings" > "Reading" section. This did not work as far as displaying a summary/excerpt so I browsed around on the Codex/forums for a week trying to resolve this myself before posting.
While browsing, I found a number of past posts related to this, including the Codex entry for the_excerpt() function. The biggest difference I have found in my theme vs. what I read in posts, is that it seems to use the_post() instead of the_content(). Since many of the posts I found were outdated (a year or more), I assumed that the_post() was an updated version. I tried replacing the_post() with the_excerpt() on index.php and home.php, but it led to a few problems. I noticed that if I replaced it only on index.php nothing happened, but when I replaced it on home.php it seems to break something. When I reload the main page, it will post an excerpt above the post, and then endlessly re-display the same post again and again until I hit stop in my browser, and also makes the sidebar disappear.
Sample code I'm referring to is a conditional (tried updating the_post() -> the_excerpt():
<?php if (have_posts()) : ?>
<?php
$i = 0;
while (have_posts()) {
the_post();
include(dirname(__FILE__).'/post.php');
if ($html = get_option($shortname.'_custom_html_'.$i)) {
echo "<div class='customhtml'>$html</div>";
}
$i++;
}
?>
<?php endif; ?>
I'm wondering if it is possibly an oversight in the template code somewhere that is causing this issue, possibly a missing HTML or PHP closing tag or something. I have tried using the <!--more--> tag in my posts which seems to work as far as displaying the summary/excerpt, however, when I validate my WP site using the W3C validator, it seems to omit closing </p> tags for some reason and cause validation errors. I have tried deactivating all plugins after making the updates to the_excerpt() but it doesn't seem to make a difference.
Thank you for taking the time to read and/or provide any guidance, it is greatly appreciated. I can provide more info if needed as well.