Hey guys, see, I have this blog www.aimdownyoursights.com, the posts are quite long and they fill up the home page, making the website longer to load for visitors. I was wondering if there is a way to just make a preview of each post with this same theme. You probably know what im talking about, just like a summary of the post and people have to click on it to see the rest. If anyone can help me out i would really appreciate it, thanks, cheers.
edit your post and add this code on html view i think... <!--more--> Code (markup): it should now only display the text before that code,,, hope that helps..
I have to edit every single post? It works, but isen't there way to include it every time i make a new post? Like, edit the singlepost.php or something?
No there is no way since the post data is written into the database. If you write a new post then just insert the MORE "function" (there is a button in the editor) after your "introduction", that's it.
well you can by using the the_excerpt() function, open your index.php find and replace the_content(); with the_excerpt(); it will display the first 55 words of the post if im not mistaken,,, i suggest you use !--more--> tag instead as you have more control on the number of words you need displayed on your excerpt...
Yes, use the the_excerpt() instead of the the_content() inside of the Loop. And that would not be in index.php, it is probably a file called home.php or frontpage.php depending on the theme. The <more> tag gives you less control, in reality, and is the lazy way out. Using the excerpt box in your post/page editor gives you even more control of the size. Plus you can cut out any extraneous stop-words, make it more "teaser-like", and have uniform boxes of two-to-three lines when you display the list of posts. Some SEO plugins or themes will use the excerpt as a meta-description in the <head> also. Cant get that with a <more> tag.
Lazy way out? LOL It is normal when you write a post that you just insert the MORE tag, no? At least I do it, because every introduction is different!
No, I don't think it is normal. If you are new to WordPress, you would not even know that tag exists. Thus this thread. It is learned, and learned from long ago before the_excerpt() ever existed. If you are set in your ways, then more power to you. But, if the guy is new, lets teach them new tricks right out of the gate. Writing excerpts, though, is an art form in itself. You can think of them as teasers, as I mentioned before. If you are looking at a long list of posts, you want them to click through to the actual post and what better way to do that -- a snappy excerpt! And yes, every introduction is different. But rarely introductory paragraphs actually describe what is inside the post, nor should they. Your post is a story with a beginning, middle, and end. The excerpt describes that story. So yes ... it is the lazy way out to use the <more> tag.
If you place a picture into the introduction (or only a picture) then the MORE tag is IMHO the best choice. Anyway, I do not use excerpts in my introductions (yes, I am lazy and damn busy).
That may be a slight exception to the rule, once upon a time however. With newer versions of WordPress you can use post thumbnails and featured images. Properly coded themes will take advantage of that and display a thumbnail in the listing. A good example of this in action would be Justin Tadlock's blog. He uses two-line excerpts effectively and the post listing is easy to scan for interesting posts to read. If you haphazardly mix different sized images with varying sized decapitated intro text or more text, quite frankly, it is harder to read and find anything you are looking for. When I stumble upon a blog that flows awkwardly it turns me off, and I just leave. My point being here is usability. If it is your style to have a rambling post list, then what the hay, go for it. Kewl. Good luck with that!
You are correct. Using the_excerpt() will display the first 55 characters from the_content(), but only if an excerpt was not previously defined in the post. You can control the length of the_excerpt() by using the excerpt_length filter, which is pretty simple to do by adding the following code to functions.php file in your theme: function new_excerpt_length($length) { return 120; } add_filter('excerpt_length', 'new_excerpt_length'); Code (markup): Vary the return value in the filter to suit your needs.