WordPress.org

Ready to get started?Download WordPress

Forums

Hide everything from before red more in full atricle. (5 posts)

  1. dompl
    Member
    Posted 3 years ago #

    Hi there.

    I have a small problem.

    I have to hide everything what appears before <!--more--> in full article.

    Is there a way of doing this?

    Many thanks for your help in advance.

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    you probably need to edit single.php of your theme and add the parameter to the_content()

    http://codex.wordpress.org/Function_Reference/the_content

    $strip_teaser
    (boolean) (optional) Should the text before the "more" link be hidden (TRUE) or displayed (FALSE).
    Default: FALSE

  3. dompl
    Member
    Posted 3 years ago #

    Hi,

    Thank you for reply.

    I have tried this:

    global $more;
    $strip_teaser = false;
    the_content();

    And it is still showing the entire article.

    Sorry, I'm new to WP. What am I doing wrong here?

    Thank you

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

    you need to add the parameter into the brackets of the the_content() function:

    for instance, try:

    <?php the_content( 'read more...', true ); ?>

    (untested)

  5. dompl
    Member
    Posted 3 years ago #

    Works perfect, thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.