WordPress.org

Ready to get started?Download WordPress

Forums

How to hide the excerpt? (9 posts)

  1. fsnelting
    Member
    Posted 8 years ago #

    I might be thinking the wrong way around... but does anyone know a way to hide the excerpt on permalink pages? Similar to the way you show the excerpt under certain conditions (and hide the rest), I would want to show what's below the <--more--> tag (and hide the excerpt).

    I used the excerpts as some sort of "covers" for posts, but than it does not make sense to have these included in the full post; they're never simply the first few lines of the text.

    Yes, I've looked at "cut" and "hide" plugins, but as far as I can see these are all based on exactly hiding what is below the more-tag or based on whether you are logged in or not.

    thanks!

    Femke

  2. Chris_K
    Member
    Posted 8 years ago #

    Not sure I completely follow. Do you have a link we could see?

  3. fsnelting
    Member
    Posted 8 years ago #

    Oh... sorry, HandySolo!
    here's the page with the excerpts:
    http://www.geuzen.org/test

    and a few of these excerpts link to single pages saved in wordpress, such as:
    http://www.geuzen.org/test/?p=42

    The small image + the text "Given today’s political climate we’ve decided to exhume this classic project" is redundant on the zoomed-in page, so I am looking for ways to exclude that part.

    Hope this is clearer?!

    Femke

  4. Chris_K
    Member
    Posted 8 years ago #

    Ah, does your theme have a single.php? If so, does it refer to both the_excerpt() and the_content()?

  5. fsnelting
    Member
    Posted 8 years ago #

    There's a single.php but this page only refers to the_content()

    ...this is why I thought it would make sense to use the_excerpt(); I thought there would be a tag like the_rest() :-)

    Maybe I should have used custom fields instead? (hmm. not so user friendly to have to put content in these)

  6. Chris_K
    Member
    Posted 8 years ago #

    Let's back up a step.

    On your front page, are you showing the_excerpt() or the_content() with <!-- more --> tags?

  7. fsnelting
    Member
    Posted 8 years ago #

    here's how the blocks on the front page are made:

    if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="box" id="post-<?php the_ID(); ?>"> <div class="<?php echo c2c_get_custom('style');?>">
    <h2><a>"><?php the_title(); ?></a></h2>
    <?php the_content(''); ?><div class="clear"></div></div></div>
    <?php endwhile; ?>

  8. Chris_K
    Member
    Posted 8 years ago #

    Ok, I begin to understand. What you're referring to as "the excerpt" is the part of the post before the more tag. And you don't want to see that in the single page view.

    That's a stumper for me!

    My initial thought would be to suggest using "the_excerpt" for your frontpage view. However, that strips pictures out (unless you modify core code) so I'm not sure that's the ideal solution.

  9. fsnelting
    Member
    Posted 8 years ago #

    Yes, that is the idea! When I add <!--more--> tags manually, html tags are not stripped from the excerpt -- It does not really matter whether I use the_content() or the_excerpt(). But I still do not understand how to exclude this part from the single page views...
    hmmm.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags