The easiest way would be to let the home page be the main blog page and use the_excerpt
in the loop instead of the_content
.
Thread Starter
kgud
(@kgud)
Thanks, but I need the main blogpage to be elsewhere in the navigation showing the full posts.
Only wanted few excerpts on the frontpage as a teaser.
Any idea on that?
As you can see I have put some kind of a loop on the frontpage page template,
no, can’t see anything from the link
– please paste the full code of that template into a http://pastebin.com/ and post the link to it here – see http://codex.wordpress.org/Forum_Welcome#Posting_Code
do you want to show the posts and the page content?
general:
http://codex.wordpress.org/Class_Reference/WP_Query
Thread Starter
kgud
(@kgud)
That looks about right. To use that as the template for a static home page, you have to name it front-page.php.
http://codex.wordpress.org/Template_Hierarchy
Thread Starter
kgud
(@kgud)
I have done that, named it front-page.php.. still not getting excerpts but am getting the page title “FORSÍÐA”.. maybe something wrong with my loop?
I’m beyond my knowledge at the moment.
you need to add a query before the loop; i.e. before this line <?php if (have_posts()) : ?>
show excerpts of all the posts
example:
<?php query_posts('cat=0&posts_per_page=-1'); ?>
http://codex.wordpress.org/Function_Reference/query_posts
Thread Starter
kgud
(@kgud)
Hi guys again
Do you know why new posts I make is not appearing in the excerpts on the frontpage?
It does appear if I change the cat to Uncategorized.
I also have a page which displays posts in one category, those posts are not appearing at the front…I have tried to have the posts in two cat, but that did not work.
Hope you can help me with this as brilliantly as you did before.
K
Instead of the above query_posts parameters, try it like this (where the number 1 is however many posts you’d like to display:
<?php query_posts('showposts=1'); ?>