• Please help. I am not sure which code to remove in index.php so that I can avoid showing posts on index.php. Here is my code for index.php

    <?php get_header(); ?>

    <div id=”content”>
    <p align=”justify”>I have some text here which will be static.

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

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

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

    <div class=”entry”>
    <?php the_content(‘Read the rest of this entry »’); ?>
    </div>

    <p class=”postmetadata”>Posted in <?php the_category(‘, ‘) ?> | <?php edit_post_link(‘Edit’,”,’|‘); ?> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?>
    </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 : ?>

    <h2>Not Found</h2>
    Sorry, but you are looking for something that isn’t here.
    <?php include (TEMPLATEPATH . “/searchform.php”); ?>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    Please help. I am really confused. I tried various combinations of deleting. Nothing works.

    drb

Viewing 5 replies - 1 through 5 (of 5 total)
  • okay, if you remove the posts from showing up in index.php, it’s likely they won’t show up at all.

    if what you’re looking for is to have a static home page without posts on it, there are other ways of going about it where index.php isn’t involved at all… is that what you’re trying to do?

    Maybe we can help better if you tell us what is it what you want to achieve?
    Killing the index.php is never a good idea, because it is used for many othr things… Useful reading: Template_Hierarchy.

    Thread Starter drb05

    (@drb05)

    I know it is a weird request. But I fell in love with WP and one of the template (free).
    Unfortunately, I did the page for one of my colleague, and he doesn’t want the posts to show up in the index.php but wish to use all features of WP.

    I have retained all sidebar features and posts that will eventually show up if somebody clicks on the category link.

    Could you please suggest alternate ways where index.php is just with some static content?

    Sorry again if it is weird request.

    drb

    It’s not a weird request, just don’t touch index.php – you can destroy the whole blog. I hope you followed and READ the article I linked above.

    Save index.php as home.php in the theme folder and edit whatever you want, put a static text etc.
    You are done.

    Thread Starter drb05

    (@drb05)

    Moshu,
    THanks for the reply. Yes I did read the article. SInce I am not proficient, critical thinking isn’t coming soon. ??

    ANyway, thanks for your suggestion. I will follow the same.

    drb

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘how to avoid displaying posts in index.php?’ is closed to new replies.