Websites for sale:
Web Hosting Reviews and Rating, Used Cars for Sale and Car Sale.
If interested please send my an email at ken@kensfi.com. Thanks!
How to make default the [Read more]
Most Wordpress blog themes we’ve met, probably more than 90% of them, display the full content of articles on the first page of the website. We do not want that. We want users to click on the article title to read more. Thus increase the number of clicks and make the site more attractive and in addition the index page will be brief.
To have a clearer idea what I’m talking about, take a look here (another blog of mine) or simply take a look on this blog home page and you’ll see articles that are not fully displayed but only with [...]. This mean you need to click the title to get into the complete article page.
You have the option to write everytime <!–more–>, or to give a click on “more” button from over the writing console, anywhere you need to split the post, but is tiring every time to do this. Let’s find out how to modify the blog template to have by default, post, all the time in this way. The method is pretty simple and you don’t need to be a guru in php (I’m not!).
To do this you need to open the index.php and search & replace the template tag the_content() with the_excerpt().
First of all you have to do a backup of index.php. Regularly I copy that file from the server on my pc, in two different folders, and I modify only one file of that two files. If it’s goes wrong I copy back the original file to the server.
The old code of my wordpress theme was:
<? if (is_home() && (!$paged || $paged == 1) || is_search() || is_single() || is_page()): ?>
<?php the_content(‘Read the rest of this entry »’); ?>
<? else: ?> endif; ?>
which I replaced with:
<? if (is_home() && (!$paged || $paged == 1) || is_search() || is_single() || is_page()): ?>
<?php the_excerpt() ?> endif; ?>
Sometimes you can get something like this:
<?php the_content(‘Read More’); ?>
or
<?php the_content(‘More »’); ?>
All you need to do in this kind of situations is to change the code to:
<?php the_excerpt() ?>
If you do not provide an explicit excerpt to a post (in the post editor’s optional excerpt field – in advanced options, under the text console), it will display a teaser which refers to the first 55 words of the post’s content. Let it by default.
Override the index.php file from the server cu modified one, test the website and drink happy a bear.:)
Done!
Popularity: 6% [?]
If you enjoyed this post, make sure you subscribe to my RSS feed!Related Posts
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.



really good stuff!
It was just the thing i was searching for from about 2 days. I managed something like this but only now i read your post and it`s great. I mean it work perfect.
How can I make it show me the “read more” under the lines ? it doesn`t appear anywhere :(
The user need to click on the subject title to get into the full article page. And I think is a better way than click on <read more> link… You did the same thing accessing this article :)
Yeah, your right but not all will understand it`s just a part of the article and if they don`t want to post comments or don`t know then what ?:)
The user that I have knows this, it’s something normal to click on title to read the article. Anyway I will give you the solution soon :)
Check this out:
http://codex.wordpress.org/Customizing_the_Read_More
Oh I see, you got it ;)
Of course I have. I`m so smart :))
Keep it up! :)