Forums

Query breaks navigation (2 posts)

  1. ridgey28
    Member
    Posted 3 years ago #

    Hello
    My quest is to display 1 full post on home page and snippets of 5 posts on the others using more tag. I successfully achieved this by inserting the following into my index.php.

    <?php if (is_home()) {
    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("showposts=1&paged=$page");
    } ?>

    then i set my blog posts shown at most to 5.
    My navigation is broken now and displays 404 errors!

    I then set the posts shown at most setting to 1 on the homepage and deleted the above code and I attempted to put it in my archive.php (which also displays category and tag posts when clicked) but it then broke my archives page.

    Currently I have set posts shown at most setting to 1 and I have just 1 post showing on the archive page which is not what i want but the navigation works fine.

    I dont know what else to try and which file i should edit.
    Can anyone help me please?

    worldoweb.co.uk

  2. ridgey28
    Member
    Posted 3 years ago #

    Now isn't that typical! I posted this problem on the forum 5 minutes a go and I just came across this page Showing multiple posts on archives page

    I entered this in my archives.php and it worked.
    <?php query_posts($query_string.'&showposts=2'); ?>

    I will leave this post open just in case it suddenly decides to stop working.

Topic Closed

This topic has been closed to new replies.

About this Topic