• I would like to have a small welcome – etc.. blurb at the top of the index.php and then have just the linked titles of the most recent posts. Titles only. I am using ihmotep theme. I am very new to php. so please be gentle.

    Here is the index.php;

    <?php get_header(); ?>
    <!– start “the loop” –>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class=”post”>
    <h3 class=”storytitle” id=”post-<?php the_ID(); ?>”>” rel=”bookmark”><?php the_title(); ?><span class=”commentnum”><?php comments_popup_link(‘0’, ‘1’, ‘%’); ?></span><?php edit_post_link(‘(e)’); ?>
    <span class=”postinfo”><?php the_author(); ?> posted in <?php the_category(‘, ‘); ?> on <span class=”date”><?php the_time(‘F jS, Y’) ?></span></span></h3>

    <?php the_content(__(‘(more…)’)); ?>

    <div class=”feedback”>
    <?php wp_link_pages(); ?>

    </div>

    <!–
    <?php trackback_rdf(); ?>
    –>
    </div>

    <?php comments_template( is_single() ); // Get wp-comments.php template ?>

    <?php endwhile; else: ?>
    <?php _e(‘Sorry, no posts matched your criteria.’); ?>
    <?php endif; ?>
    <!– end the loop –>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • 1. Don’t post long code here, please!
    It is difficult to read and nobody really bothers to take a look at it. You can use http://pastebin.com or similar services – and post back with the URI.
    For posting small code snippets, please read carefully the instructions here below the text input area: the “backticks” usually are located on top-left of your keyboard, where ~ [tilde] is.

    2. Delete the_content tag.

    3. And after that you’ll be back again complaining that your posts disappeared everywhere.
    That’s because the index.php is used for many things, see Template_Hierarchy.
    My suggestions:
    a) save index.php as home.php and make your editing in that file – home.php will be displayed as your “frontpage”
    b) create all the necessary template files to avoid using index.php in other views

    Thread Starter callahank

    (@callahank)

    Sorry for the long code. Thank’s for the advice. It worked for me.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Titles only on index.php’ is closed to new replies.