WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] single post on homepage- what's wrong with this code? (4 posts)

  1. j0llyr0ger
    Member
    Posted 8 years ago #

    At one point I hade my index.php configured to show only one post. Now, after tinkering with it two posts are showing and I cannot figure out what is wrong.

    I have tried searching here but didn't find what I wanted. I have read the loop and query_posts pages on the codex, but I must be missing something because this isn't working right.

    Can somebody spot my error for me, please?

    Here's the code of my index.php


    <?php get_header();?>
    <div id="main">
    <?php query_posts('showposts=1');?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <h2 class="title">" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h2>
    <h3 class="date"><?php the_time('F jS, Y') ?></h3>
    <!--<h4 class="timestamp">7:35 pm</h4>-->
    <?php the_content(); ?>
    <h5 class="postmeta"><span class="tags"></span><span class="comments"><?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></span></h5>
    </div>
    <!--<?php trackback_rdf(); ?>-->
    <?php endwhile; ?>
    </div>

    <?php else : ?>
    <?php echo "something's gone wrong...";?>
    <?php endif; ?>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

  2. j0llyr0ger
    Member
    Posted 8 years ago #

    I think this must have been caused by using a / in the title of a post. It seems that the only post that causes the one just before it to also show has the slash character in its title.

    Maybe it's a bug, who knows?

    I just added another post and it shows on the front page by itself so I am satisfied.

  3. wengkies
    Member
    Posted 8 years ago #

    hello

    is there any update here - I also want to display just the articles that i've just posted...

    here's the example http://www.rockworship.com display only the latest articles in their blog does anybody knows how to do it?

    thanks in advance for your help appreciate it...

  4. wengkies
    Member
    Posted 8 years ago #

    ooppss just to clarify I know the dashboard can do it but what I mean is if I type 1 it works but the problem is if you add those external links and the recent articles when you click the continue reading you can still see them below the comments tab or in the upper part of the comments... What I want to do is to eliminate those external links when I click the continuation...

    Tanks again

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.