Forums

[resolved] asides hack makes my index page show only two posts (4 posts)

  1. ghmercado
    Member
    Posted 4 years ago #

    hi i followed this tutorial to the letter.

    Asides for category 404 now appear on my sidebar, but for some reason my home page is now only showing 2 posts instead of the 12 I set it to show.

    It appears this line of code is the culprit:

    <?php if (in_category('404') && is_home() ) continue; ?>

    Page 2, on the other hand, shows 6 posts, and then Page 3 suddenly shows just 5.

    Here's a link to my index.php, and to my sidebar.php and finally to my blog.

    any clues? Please please please please please help. Many thanks in advance.

  2. That codex link always worries me. It's right but really needs re-writing to make it clearer... work for a different day.

    Did you backup your index.php and sidebar.php files? Step one is put it back to the way it was before to start off cleanly.

    Do you want to just have asides on your index.php, sidebar, or both?

    If it's your index.php then give this a look.

    It's a good description on how to just add and theme asides in the main content.

    If it's the sidebar, you may want to look at a plugin.

    Good luck,

    Jan Dembowski RS-O-H
    (Recovering support-o-holic)

  3. ghmercado
    Member
    Posted 4 years ago #

    silly me.

    I realize now that the asides are counted as part of the 'Blog pages show at most'.

    I used this code on my sidebar:

    <?php
     global $post;
     $myposts = get_posts('numberposts=5&category=404');
     foreach($myposts as $post) :
     ?><li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>

    you can see the numberposts are set to only show 5, but my 'Blog pages show at most' is set to 30, and the posts on my index are showing only 8. That means it's still counting the other posts in category 404 (my asides category).

    this also means that everytime I add to category 404, the number of posts on my index page will be reduced by 1.

    to which my reaction would be: DANG.

    oh well. I guess Ive no choice but to go the sidebar route. thanks jan.

  4. ghmercado
    Member
    Posted 4 years ago #

    oh well. I guess Ive no choice but to go the sidebar route. thanks jan.

    what I meant was, I have no choice but to go the PLUGIN route.

Topic Closed

This topic has been closed to new replies.

About this Topic