• ResolvedModerator t-p

    (@t-p)


    Hi,

    I use the following function to list all archive posts.

    /archive”>

    How can I break posts into pages with say 25 posts per page?

    Your help will greatly be appreciated. Thanks

Viewing 15 replies - 16 through 30 (of 31 total)
  • Moderator t-p

    (@t-p)

    Thanks vtxyzzy,

    I don’t understand why that didn’t work, unless the posts are being displayed by something other than archive.php.

    No.

    In fact, I am not using any plugins or woidgets. I use default theme. Pretty simple board.

    I want to thank both of you for patient and help.

    happy new Year!

    OK, you are using the default theme. Did you actually try setting posts per page as I suggested in the first reply? That works for me in the default theme for archive pages.

    Have you edited some of the code in the theme? Where in the code is the function you posted?

    Moderator t-p

    (@t-p)

    Thanks vtxyzzy,

    OK, you are using the default theme. Did you actually try setting posts per page as I suggested in the first reply? That works for me in the default theme for archive pages.

    Yes, that works fine.

    Have you edited some of the code in the theme? Where in the code is the function you posted?

    The above code worked fine to control the sidbar archive (post per page=25) when placed in the archive.php as suggested by t31os_

    Which I have already set through the admin (setting posts per page).

    However, what I am trying to accomplish is different than the archive elemment in the sidebar.

    I have created a page, which is linked in the horizontal menu bar below the header. I call it “Full Archive”. When a user clicks on it, that users sees a complete list of all posts alphabetically listed by titile and bulletizd on one page. What I intend to do is, instead of having that list including all titles on just one page, break it down to, say 25 titles per page.

    Now this totally different than the archive element in the sidebar or the admin setting of posts per page.

    Now we may be getting somewhere. I assume you wrote a template php file for your Full Archive page.

    Can you post a section of the code from that template? Say five or so lines before and after the loop, the ‘while (have_posts())’ part?

    Moderator t-p

    (@t-p)

    Thanks vtxyzzy, here is that entire template:

    <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    
    /*
    Template Name: gurarchive
    */
    ?>
    
    <?php get_header(); ?>
    
    <div id="content" class="widecolumn">
    
    <h2></h2>
    <ul>
    <?php wp_get_archives('type=alpha');?>
    </ul>
    
    </div>
    
    <?php get_footer(); ?>

    I have created a file that I think will work for you. You can get it from WordPress pastebin.

    If this works, please mark this topic ‘Resolved’.

    Moderator t-p

    (@t-p)

    Thanks vtxyzzy,

    Appreciate your help.

    Moderator t-p

    (@t-p)

    Hi vtxyzzy,

    thanks for helping the other day.

    Itried your code, and found couple of problems with it.

    1. pagination, page 1 comes out ok, but when clicked on the subsequent pages (page 2, 3, etc.), I end up at my blog’s front page!

    2. w3validator indicates bunch of errors and warnings.

    It’s possible when #1 is fixed, #2 may go away.

    I tried to fix these both issues but no luck.

    Again thanks for your help. TaraP

    I will look into this right away. Sorry for the trouble.

    Moderator t-p

    (@t-p)

    Thanks vtxyzzy,
    I Appreciate your help greatly.

    Are you using pretty permalinks? I think that the program may fail because of that. I am using that same code in a number of places and it works, but none of them have pretty permalinks. I will modify to fix that and send a new copy in a day or two.

    Moderator t-p

    (@t-p)

    yes vtxyzzy, I am using pretty permalinks. Thanks for your time and patient.

    OK – I think I have it fixed. Get the new one from http://wordpress.pastebin.ca/1747743.

    Be sure to change the $limit back to 25; I set it to 4 for testing so I would get lots of pages.

    Moderator t-p

    (@t-p)

    Thanks vtxyzzy,

    It works!

    Good News! Thanks for reporting the problem and being understanding.

    Please let me know of any more problems or questions.

    Mac

Viewing 15 replies - 16 through 30 (of 31 total)
  • The topic ‘How to break posts into pages with 25 posts per page?’ is closed to new replies.