I want to show all posts in the "Nyheter" category in my Template Page, i´ve made the custom page by doing the standard Wordpress template identifier thingy:
<?php /* Template Name: Nyheter */ ?>
Works great, then i´ve added the header and all Wordpress includes. Before the loop i´ve added the:
This will include the posts, but the post as a whole, or rather: all the content shows up, it doesnt break with a "Read more" text as it should, i use the same query post, 100% the same code on the index file and on the index file it works great, but not in my custom page.
I think because the index page is designed to have the read more link in it. a custom page is designed to show the entire post. You can use this code to display just the title of the post and it will make that title a link
I want to show all posts in the "Nyheter" category in my Template Page, i´ve made the custom page by doing the standard Wordpress template identifier thingy:
Works great, then i´ve added the header and all Wordpress includes.
Before the loop i´ve added the:
Then the standard (not styled yet)
This will include the posts, but the post as a whole, or rather: all the content shows up, it doesnt break with a "Read more" text as it should, i use the same query post, 100% the same code on the index file and on the index file it works great, but not in my custom page.
Anyone that know what the problem is? ;)
<?php $recent = new WP_Query("cat=14&showposts=0"); while($recent->have_posts()) : $recent->the_post();?>
<h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<?php endwhile; ?>
it works off of the category id. So you would have to change the category number. in this case above it's 14
<?php the_content('Läs mer...'); ?>