I had an interesting problem yesterday. We wanted to make a new frontpage for a WordPress site. The frontpage has need the same layout than the category listing page. We used the same code, what called the loop.php to show the posts, and everything was good, except one “small” thing. The WordPress worked differently if we called a category listing page, than on the frontpage.
On the frontpage the loop showed the whole articles, but I want to show only the introductions of the posts, till the “Read more” line. Because the original site used a template what modified by an other developer, I tried to find the problem there, but was not success.
Finally a really small change solved the problem;
global $more;
$more = 0;
the_content(‘Read more…’);
There is a control variable, named $more, what controls the function, to show or don’t show the whole post, and the default value of this variable is “1″ in case of template pages, because they usually show single posts. We have to turn the value to 0, and the function will show only the introduction part of the posts.
Related site: www.mercedesbenzmadrid.com



















