Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Limit number of post on archive page

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #35095
    fectio1
    Member

    keep getting an end syntax error. I am trying to limit the number of post displayed on a archive page. Thanks in advance.

    
    
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("posts_per_page=1&paged=".$paged);

    if (have_posts()) : while (have_posts()) : the_post(); ?>


    ">">



    'Pages: ', 'next_or_number' => 'number')); ?>












    #90347
    TheDoc
    Member

    Try this:

    
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts($paged . "&posts_per_page=1&paged=' .$paged);
    ?>
    #90351
    fectio1
    Member

    Thanks, but now I’m getting an T_endwhile error.

    #90374
    fectio1
    Member

    So I got the code to work with a lot of help, but now Im getting a 404 error when navigating to the next page. Here is my structure.

    -> parent category

    –> children category

    All of the children are displayed on a certain page. You select the category which then displays all the post within that category. This is where I want to limit the number displayed. Hopefully that gives a better picture.

    url for page that displays childern

    localhost/?page_id=5

    url for category selected

    localhost/?cat=4

    url for next post link which I get the 404 error

    localhost/?cat=4&paged=2

    Here is the complete code.

    Thanks in advance

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.