WordPress.org

Ready to get started?Download WordPress

Forums

How to hide post teaser text from post? (7 posts)

  1. ronronmx
    Member
    Posted 4 years ago #

    Hi, I have been looking around for a while but can't find a solution.

    I use the "read more" on all my post to only show a teaser text on my home page. The problem is that teaser text is also displayed on the full post content.
    I want to hide the teaser text from the full post content, so that the post will actually start at the part "below" the read more tag.

    Is there a plugin that does that?

    Thanks!

  2. alism
    Member
    Posted 4 years ago #

    Can you use the excerpt instead?

  3. ronronmx
    Member
    Posted 4 years ago #

    No I want to keep my excerpts for the search engine display text only, and also keep it pretty short, so I don't want to use it as my post teaser text.

  4. alism
    Member
    Posted 4 years ago #

  5. ronronmx
    Member
    Posted 4 years ago #

    Thanks for the link alism, but I tried that solution and it breaks the content layout :(
    I'm surprised there isn't a plugin for wordpress which allows you to either write custom teaser text that don't appear in the full post or just hide part of a text in the full post only!

    If I wanted to use the excerpt, how would I do it? Do I need a plugin?

    Thanks for your help!

  6. epsi
    Member
    Posted 4 years ago #

    Sorry for waking up this old thread.

    Cheers, ronronmx...
    Now we have a working solution using very simple shortcode.

    add_shortcode('noteaser', 'shortcode_noteaser');
    
    function shortcode_noteaser($atts, $content = null)
    {
    	if (is_single()) return '';
    	else return do_shortcode($content);
    }

    Then in your post

    [noteaser]
    <p>Noticer mess-age</p>
    [message text="you can run another shortcode inside noteaser shortcode"]
    [/noteaser]
    <!--more-->

    It might help little for quick fix.*

    ~epsi

    *note:
    Dunno if shortcode is an elegant solution (politically correct).
    I'm new in wordpress, and still confused about excerpt.

  7. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    @epsi:

    even easier:
    the solution is in the codex - probably the most unread document in wordpress (lol)
    http://codex.wordpress.org/Customizing_the_Read_More#Read_More_Techniques

Topic Closed

This topic has been closed to new replies.

About this Topic