• I’m sorry guys, I have honestly tried everything and have finally given up.. After much research (PS this is my VERY FIRST WordPress Site so I think I’m doing pretty good) I just can’t figure this out:

    Ali Manek.com
    <P>
    I can’t get the main page/homepage to show only the Excerpt from my posts. Instead it’s the entire blog.

    So far i’ve figured out that the Index.php for my theme (intrepidity) is going directly for the Posts.php template…

    Here is the Index.php template:

    <?php get_header(); ?>
    	<?php
        while (have_posts()) : the_post();
        	include(dirname(__FILE__).'/post.php');
        endwhile;
        ?>
    <?php get_footer(); ?>

    Now the Post.php is all funky… Can’t figure out what to do… I made some changes like replacing )the_content with the_excerpt but that got me a fatal error. And I tried some other things and then my whole page got turned upside down… It’s a mess… Just a mess…

    <?php
    global $more;
    $template_url = get_bloginfo('template_url');
    ?>
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
        <div class="entry_header">
            <p class="entry-date"><?php the_time('M y') ?><br /><span class="date"><?php the_time('j')?></span></p>
            <?php echo (is_home()) ? '<h2 class="home">' : '<h1>'?><a href="<?php the_permalink() ?>"><?php the_title(); ?></a> <?php edit_post_link('Edit', '<span class="editpost">', '</span>'); ?><?php echo (is_home()) ? '</h2>' : '</h1>'?>
            <?php if (FALSE && $post->comment_status != 'closed'):?>
            	<div class="comment-bubble"><span><?php comments_popup_link('<span class="nocomment">No Comment</span>', '&nbsp;1 Comment', '% Comments'); ?></span></div>
            <?php endif;?>
            <div class="recover"></div>
        </div>
    
        <div class="entry_content">
            <?php $more = 0;
    		the_content('<br /><br /><span class="readmore-icon">Read the rest of '. get_the_title('', '', false). '</span>', FALSE);
    		wp_link_pages();
    		?>
    
    </div>
    
    <div class="postedinfo"><?php the_tags('<span class="tag-meta">Tags: ', ', ', '</span><br />'); ?> <span class="categories"></span> </span>.
            <?php if (isset($options['tags'])) : ?><span class="tags"><?php the_tags('', ', ', ''); ?></span><?php endif; ?></div>
        </div>

    Any help would be soooooooo appreciated!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter amanek

    (@amanek)

    Right so for no apparent reason, I decided to copy my Category.php code INTO the Post.php code (removing the original) since my categories show in Excerpt mode which is what I’m trying to do… but that didn’t work… created a real mess on the homepage….

    PS – I’m really trying to have Excerpt on the MAIN/HOME Page, but I’d like them to be able to click once and get to the full Post… not have to click twice or get redirected to the categories and then… well you know what I mean…

    PLEASE HELP…

    try clearing out everything and only doing
    <?php the_content('<br /><br /><span class="readmore-icon">Read the rest of '. get_the_title($post->ID). '</span>', FALSE);?>

    see if that give you the excerpt like you want. and notice that get_the_title() only accepts one param, the ID, or nothing and it assumes that the id passing is the id of your current post/page.

    Also, I think that if you’re trying to get the excerpt using this method you have to use the “Insert more tag” option in the WYSIWYG which is the icon that looks like two pages separated by a dotted line. I could be wrong, I don’t generally snag the excerpts that way.

    Josh Feck

    (@builtbynorthby)

    Hey Ali,
    I looked through the code on the theme, and it looks like it’s setup to use the <!–more–> tag out the box.
    If you want to use the excerpt, I suggest making the changes to home.php, as that is the template for your home page. Secondly, since other templates are using post.php, a better way to make your changes would be to make a copy of post.php and then rename it something else, like posthome.php
    Now you’ll want to remove any code that has anything to do with the more tag, then replace the_content with the_excerpt. Like this:
    <div class=”entry_content”>
    <?php the_excerpt(); ?>

    Finally point your home.php to this new template:

    include(dirname(__FILE__).’/posthome.php’);

    I hope that makes sense, and helps. If I could give one more tip it would be to make your changes update proof and put them in a child theme.

    Thread Starter amanek

    (@amanek)

    Oh my GOD… I’m a muppet is what i am…

    thank you guys SO much…

    simplistik – before implementing what you suggested, i went to discover this “more” button you were talking about and low and behold, after using that – IT WORKED!!!

    Sorry for the trouble!!! I can’t believe how many hours I spent on this last night just to find out how easy it it.. lol

    U guys are great…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Full Article Displaying, Not the_excerpt showing on Main Page’ is closed to new replies.