How would I go about basically creating an index but on a different page? I want to display all the recent posts with pagination still working as if it were the index. I can go into more detail if need be. Thanks in advance.
How would I go about basically creating an index but on a different page? I want to display all the recent posts with pagination still working as if it were the index. I can go into more detail if need be. Thanks in advance.
look into using a page template http://codex.wordpress.org/Pages#Page_Templates; possibly starting with a copy of index.php.
then add a query before the loop to catch the recent posts.
http://codex.wordpress.org/Function_Reference/query_posts
do you want to keep the posts on the front page as well?
you might also want to read: http://codex.wordpress.org/Creating_a_Static_Front_Page
Where would I go about adding
php query_posts( 'posts_per_page=5' );
? I'm not super familiar with php yet.
I have everything else ready just dont know where to insert the php_query_posts ^_^
the loop usually starts with some code like:
<?php if( have_posts() .....
before that line, add the:
<?php query_posts('posts_per_page=5'); ?>
if that does not pull the most recent posts, you might need to expand it;
example:
<?php query_posts('post_type=post&posts_per_page=5&cat=0&paged='.get_query_var('paged')); ?>
for more possible parameters, see http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
This is what is currently in -
<?php query_posts('post_type=post&posts_per_page=15&cat=0&paged='.get_query_var('paged')); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
Am I suppose to create a page template, create a page, and assign it to the template in which I have that code in?
yesAm I suppose to create a page template, create a page, and assign it to the template in which I have that code in?
it might help if you could post a link to your site to illustrate what you have so far, and what you would like to achieve.
I got it to work, for some reason the name of the page must have been created before and it was causing a problem. Thanks for all the help I really appreciate it.
I'm launching the site soon for everyone to see.. I've been working on it for about 2 months. A magazine site :D
well done ;-)
please mark this topic as 'resolved' - thanks
You must log in to post.