• I have set up my site almost the way I want it, but instead of having the loop only show on the index page it is showing on all of my pages.

    https://lethacovey.com

    Is there some way that I can tell it to only show on the index page?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You are doing something wrong, for sure…
    Since I don’t really understand the structure of your files just by looking at your site, it would be beneficial if you describe WHAT did you do with the Loop and how those files (like certificates.php e.g.) are related to WP… and so on.
    Help us to help you ??

    Thread Starter letha

    (@letha)

    This is what I did to the Loop (try not to be too upset at the mangled mess):

    <?php require_once(“/home/lethacov/public_html/wordpress/wp-config.php”); // Change this for your path to wp-config.php file ?>

    <div id=”blogs”>
    <?php query_posts(‘showposts=1’); ?>
    <?php while (have_posts()) : the_post();
    if( $post->ID == $do_not_duplicate ) continue; ?>
    <div class=”post”>
    <h2 id=”post-<?php the_ID(); ?>”>“><?php the_title(); ?></h2>
    <div class=”small”>
    <?php the_time(“l”) ?><BR><?php the_time(“F j, Y g:i a”) ?>
    </div>
    <div class=”article”>
    <?php the_content(‘Read the rest of this entry »’); ?>
    </div>
    <p class=”postmetadata alt”>Posted in <?php the_category(‘, ‘) ?> | <?php comments_popup_link(‘No Comments’, ‘1 Comment’, ‘% Comments’); ?><?php edit_post_link(‘Edit’,’ | ‘,”); ?>
    <!– <?php trackback_rdf(); ?> –>
    </div>
    <?php endwhile; ?>
    <div class=”navigation”>
    <div class=”alignleft”><?php posts_nav_link(”,”,’« Previous Entries’) ?></div>
    <div class=”alignright”><?php posts_nav_link(”,’Next Entries »’,”) ?></div>
    </div>
    </div> <!– end blogs –>

    I then placed that on the index.htm of the main site (not wp). I’m starting to think that where I placed the Loop is really dynamic template. I’m hoping there is some way to tell the loop to only display if it is the top page.

    I hope I didn’t confuse anyone….if you can’t tell, I’m really new to this and kinda winging it (and pretty much falling out of the sky)

    Thanks ??

    I don’t think your main index is a .html file. In that case the Loop should NOT work – it works only in php files!

    If your main index is used (by some other script or something) to display all your other webpages, then the Loop will be present on all of them.

    You still didn’t give any infor about the site structure…

    And as a final note: I could never make it work with that wp-config require line, seemingly it always causes more troubles than gives solution.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Blog posts on too many pages’ is closed to new replies.