Hi everyone, I have a site, www.utsc-isc.ca and I have a problem with the excerpt. If you look at the index page, there are 2 columns at the bottom: Latest ISC News and Upcoming Events. I have an excerpt function in place so that people can enter in the excerpt when creating either 1.) news or 2.) events, and it will show that excerpt. If there is no custom excerpt, then the first 20 words of the post shows. HOWEVER, I have found that many times, if I try to edit a post, after when I head back to the index page that the excerpt will disappear. Only the title remains. I have to refresh many times before the excerpt reappears. The following link is to show what I mean by the problem. Below is the code. http://postimage.org/image/2wqrsp8h0/ Can anyone help me out here? Thanks, Jason <?php //'excerpt' for pages//alchymyth 2011//fix for pages with <!--nextpage--> // if( $numpages >1 || end(explode('/',get_permalink($post->ID))) == end(explode('/',wp_get_referer())) ) : $length = 20; //set length in words $text = get_the_excerpt(''); $text = apply_filters('the_excerpt', $text); $text = str_replace(']]>', ']]>', $text); $text = strip_shortcodes( $text ); $text = strip_tags($text); $words = explode(' ', $text, $length+1 ); if (count($words)> $length) { array_pop($words); $text = implode(' ', $words); } else { $text = implode(' ', $words); } $text = apply_filters('the_excerpt', $text); echo $text; endif; ?> PHP:
Edit the post. Close your browser. Open another browser. (Use IE to edit, then open Firefox - something like that.) Go to the site. You should see the ecxerpt. I suspect it's a caching situation in your browser. (If I'm wrong, it cost you 60 seconds to find out.)
hey rukbat, you are right it is a cache problem. how do I make it so that it doesn't do that? as I have other people (not knowledgable in anything besides clicking the "add new post"), is there anyway to fix the cache problem? I don't see why it would cache the part where it shows none of the excerpt though? Thanks, Jason