• I would like the articles on the main page of my blog to just show the title of the srticle until someone clicks the title then they see the whole thing….kinda like an actual news website where people click the articles that interest them……

    thanks for your help!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter godsreal

    (@godsreal)

    help is appreciated!

    thanks

    Hi godsreal!

    In your Main Index Template, look for The_Loop.

    In my template, it looks like this:

    <?php while (have_posts()) : the_post(); ?>
    
    	<div class="post" id="post-<?php the_ID(); ?>">
    		<div class="posttitle">
    			<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    			<p class="post-info">This post was scribbled on <?php the_time('F jS, Y @ H:i:s O (T)') ?> by <?php the_author_posts_link() ?>and is filed under the category <?php the_category(', ') ?>.<?php edit_post_link('[Edit this post]', '', ''); ?>
    		</div>
    
    		<div class="entry">
    			<?php the_content('Continue Reading &raquo;'); ?>
    		</div>
    
    		<p class="postmetadata" style="text-align: right;"><?php comments_popup_link('Comments: <span style="font-size:12px; border:1px solid grey">&nbsp;0&nbsp;</span>', 'Comments: <span style="font-size:12px; border:1px solid grey">&nbsp;1&nbsp;</span>', 'Comments: <span style="font-size:12px; border:1px solid grey">&nbsp;%&nbsp;</span>'); ?>
    
    		<?php comments_template(); ?>
    	</div>
    
    <?php endwhile; ?>

    the_title() is the function for showing the title of your post. The rest is just additional info. So, it ought to work if you shorten it to this:

    <?php while (have_posts()) : the_post(); ?>
    
    	<div class="post" id="post-<?php the_ID(); ?>">
    		<div class="posttitle">
    			<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    		</div>
    	</div>
    
    <?php endwhile; ?>

    Remember: this is what my template would look like. If you use a different theme, it might have a slightly different code in it.

    Not quite sure if one can leave the comments_template() out… you’ll have to check. So, do not forget to make a backup! ??

    Thread Starter godsreal

    (@godsreal)

    thanks, in my page template it looks like this:

    <?php get_header(); ?>

    <div id=”content” class=”narrowcolumn”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <h2><?php the_title(); ?></h2>
    <div class=”entrytext”>
    <?php the_content(‘<p class=”serif”>Read the rest of this page »</p>’); ?>

    <?php link_pages(‘<p>Pages: ‘, ‘</p>’, ‘number’); ?>

    </div>
    </div>
    <?php endwhile; endif; ?>
    <?php edit_post_link(‘Edit this entry.’, ‘<p>’, ‘</p>’); ?>
    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    so, what should I clip?

    Thanks bunmches!!!!!!

    Thread Starter godsreal

    (@godsreal)

    this is my main index template, is this the one that needs to be adjusted?

    <?php get_header(); ?>

    <div id=”content” class=”narrowcolumn”>

    <?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><?php the_time(‘F jS, Y’) ?> <!– by <?php the_author() ?> –></small>

    <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 »’); ?></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 : ?>

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

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    The page template is actually used to show the whole post when the title is clicked on the main weblog site, so do not change anything there.

    Try to shorten the part between “while” and “endwhile” in your main index template shown in your recent post into something like this:

    <?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><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
    </div>
    
    <?php endwhile; ?>

    This will leave nothing but the title and the time of the post and oughta work.

    Thread Starter godsreal

    (@godsreal)

    ok, another problem…my wordpress theme editor says “If this file were writable you could edit it.”

    and it didnt let me edit it. any idea what this is all about?

    thanks again for all your help! ??

    Thread Starter godsreal

    (@godsreal)

    ^^^^^^

    thanks!

    Thread Starter godsreal

    (@godsreal)

    any further help????

    You have to change the attributes of your template file so that WordPress can actually write into it.

    Normally, that would be 644 or -rw-r–r–.

    Try setting it to 666 (-rw-rw-rw-)

    or 777 (-rwxrwxrwx), if 666 don’t work

    via FTP.

    Or: download the template file, edit it on your computer, and upload it again.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How do I make it so the post title is all that shows on the main page….’ is closed to new replies.