• Hi, I am currently developing a site based around wordpress (1.3a, from the nightlies) that has a single post on the front page. I also want to have 10 posts per page for categories and archive pages.
    Currently, to achieve that I have to set the posts per page to be 10, and just don’t use all of the wordpress loop on the home page (checking it with is_home()). This works, except for two problems.
    Firstly, the previous / next links (generated by posts_nav_link()) will skip 9 posts when the go to the second page.
    Secondly, it must be slightly inefficient to get 10 posts out of the DB and then discard 9 of them. I would quite like to fix that.
    Does anyone have any ideas for a solution to this.
    Thanks,
    Andrew Brehaut

Viewing 7 replies - 16 through 22 (of 22 total)
  • Sorry it took awhile to reply Hilary.. =( Was watching some movies tonight..anyway, yeah it’s working just fine on my WP Version 2.0. =)Reminds me, I gotta reset the amount on my index page again…maybe lower it a bit lol..

    spencerp

    I’m trying to modify this slightly so that I can have a specific category display only a single post per page. To do so I’ve added:

    if (is_category('9')) {
    $num = $posts_per['photoblog'];
    } else {
    $num = $posts_per['category'];
    }

    under the elsif for the $query->is_category, but it seems to be ignoring it. What am I missing?

    Thanks,

    -Tim

    Hello,

    Do you think it’s possible to adapt it so that it displays only the last posts per category on index.php? How would the code look like?

    Thanks,

    Diplo

    Thanks so much.

    It’s exxxxxactly what I was looking for!

    If you’re going to use the plugin for categories, you need to define $num_posts_in_category and register it as a global variable.

    $num_posts_on_home = 1;
    $num_posts_in_category = 20;
    function custom_posts_per_page($query_string) {
    global $num_posts_on_home;
    global $num_posts_in_category;
    $query = new WP_Query();

    This looks like a great plugin, but it lacks any explicit directions. Can someone please explain exactly HOW to use it? I have uploaded it and activated it….now what?

    If the development work on this plugin has been completed, someone should introduce the plugin by documenting the installation procedures and a brief overview/demo of what it actually accomplishes.

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘Single Post Homepages in 1.3a’ is closed to new replies.