• I’m using tastelessly theme with newest wordpress. This theme won’t let me post more than one without the other posts moving over to the “recent posts” column. Is there a way to change the code to allow let’s say 7 posts? I’ve been reading about WP loop but don’t know if I’m getting the right information.

    Help?

Viewing 15 replies - 1 through 15 (of 15 total)
  • http://codex.wordpress.org/Template_Tags/query_posts

    check before the wordpress loop for a query_posts – if not one use this, if is one add showposts=7
    query_posts($query_string.'&showposts=7');

    showposts=1 – use showposts=3 to show 3 posts.

    loop start:

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

    Thread Starter hankeester

    (@hankeester)

    Thanks for the reply, I will try editing the index.php file within the particular theme I’m using…

    Thread Starter hankeester

    (@hankeester)

    Here is the code from the index.php within the theme folder I’m using.
    I’m stumped on it. I see a have_posts but no “show_posts”. Where would I add the string of code you pointed out above?

    <?php get_header(); ?>

    <?php if (have_posts()) : the_post(); ?>

    <!– start content –>
    <div id=”content”>
    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <h1 class=”title”>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></h1>
    <p class=”meta”><small>Posted on <?php the_time(‘F jS, Y’) ?> by by <?php the_author() ?> <?php edit_post_link(‘Edit’, ‘ | ‘, ”); ?></small></p>
    <div class=”entry”>
    <?php the_content(‘Read the rest of this entry »’); ?>
    </div>
    <p class=”links”><?php comments_popup_link(‘No Comments’, ‘1 Comment’, ‘% Comments’); ?>     ” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”>Permalink</p>
    <p class=”tags”><?php the_tags(‘Tags: ‘, ‘, ‘, ‘ ‘); ?></p>
    </div>
    </div>
    <!– end content –>

    <!– start sidebar one –>
    <div id=”sidebar1″ class=”sidebar”>

      <li id=”recent-posts”>
      <h2>Recent Posts</h2>
      <?php while (have_posts()) : the_post(); ?>
    Thread Starter hankeester

    (@hankeester)

    I added this after the <?php if (have_poste()) : the_post();

    query_posts($query_string.’&showposts=7′);

    above is what was added since I did not see a “show_posts”
    but nothing is happening..I’m sure I’m inserting into the
    wrong place, I’m not php script savvy.

    You need to add it before the

    <?php if (have_posts()) : the_post(); ?>

    line – ie before the start of The Loop.

    Thread Starter hankeester

    (@hankeester)

    I should’ve added on the last post that I tried that when I was inserting the code. I put the string after and before. There is a 2nd column that’s titled recent posts. This is where the previous posts roll over to. Does the code for the “recent posts” need deleted or modified?

    Thread Starter hankeester

    (@hankeester)

    LIKE THIS: BUT STILL NOT WORKING

    <?php get_header(); ?>

    <query_posts($query_string. ‘&showposts=7’);>
    <?php if (have_posts()) : the_post(); ?>

    <!– start content –>
    <div id=”content”>

    Sorry – I didn’t read your posted code properly.

    You don’t have a while statement on that first part of the loop, so it’s correctly displaying the first post only. The while is in the second part of the loop (under Recent Posts). So you’ve got a single loop displaying posts in two different areas of the page. Interesting approach but not one that seems very flexible.

    Ideally I think you probably need more than 1 loop – which is a whole different ball game.

    Or you could amend the first part of the loop to include the while and use the Recent Posts widget to handle the side bar display.

    Thread Starter hankeester

    (@hankeester)

    yes, I’ve read that multiple loops are a different story…
    which leads me to think I should be happy with only one post; then secondary posts being posted under the “recent post” category….

    Hello, I’m having a similar issue. I’m just starting my blog, and I have 2 posts up. I want them both to display … in fact, up to 5 posts at a time. I’ve read the Multiple Loop area but am confused as to what to put where to make that happen. Can you help? Thanks.

    Here’s my index.php code

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

    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <h2>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></h2>
    <small>by <?php the_author() ?> ~ <?php the_time(‘F jS, Y’) ?> <?php edit_post_link(‘(edit)’); ?></small>

    <div class=”entry”>
    <?php the_content(‘Continue reading »’); ?>
    </div>

    <p class=”postmetadata”>Filed under: <?php the_category(‘, ‘) ?> | <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?></p>
    </div>

    <?php endwhile; ?>

    <div class=”navigation”>
    <div class=”alignleft”><?php next_posts_link(‘← Previous Entries’) ?></div>
    <div class=”alignright”><?php previous_posts_link(‘Next Entries →’) ?></div>
    </div>

    <?php else : ?>

    have you told WP how many posts to display per page in your settings?

    Yes – here are the settings under Settings > Reading

    Blog pages show at most [10] posts

    For each article in a feed, show Full text

    It seems like this would display up to 10 posts on the page, with full text. Instead, I get the most recent post fully displayed, and then any posts after it with only summary (title, date).

    http://elizabethjazz.com/ if you want to check it out…

    That sounds like a theme issue. You could drop a copy of your theme’s index.php file in the WordPress pastebin and post the pastebin url here. Perhaps someone will be able to spot the problem and suggest a solution.

    Thanks, Esmi.

    Here’s the URL of my index.php file:
    http://wordpress.pastebin.ca/1794852

    Try removing:
    <?php query_posts($query_string.'&showposts=5'); ?>

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘want more than 1 post on homepage’ is closed to new replies.