• Hi,

    How can i remove <p></p> from Read More while using the_content(‘Read More’); ?
    I’d like the text to be in <p> but without Read More button.

    Or if that’s impossible is there any way to display element on frontpage only if post is splitted using <!–more–> tag ?

Viewing 7 replies - 1 through 7 (of 7 total)
  • How can i remove <p></p> from Read More while using the_content(‘Read More’); ? I’d like the text to be in <p> but without Read More button.

    Sorry? Can you explain a little further what the problem is? Why are the <p></p> tags a problem? Do you want to use ‘read more’ or not?

    Thread Starter newkind

    (@newkind)

    I want to remove <p> wrapping Read More button.

    To display my content i use the_content(‘Read More’). This returnes my content in paragraphs <p></p>. At the end of text there’s ‘Read More’ button that’s leading to the full text. It’s also wrapped in <p></p>. I want to remove paragraphs only from ‘Read More’ so they would be around content but not read more button.

    So my text would be not like :

    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras elementum luctus purus. Suspendisse porta fringilla lectus nec iaculis. Proin in purus erat, et fringilla eros.</p>
    <p>Read More</p>

    but :

    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras elementum luctus purus. Suspendisse porta fringilla lectus nec iaculis. Proin in purus erat, et fringilla eros.</p>
    Read More

    Can’t be done with the_content() – although you could try using get_the_content

    Well, this works for me; it is in index.php:

    <div class="entry">
    <?php the_content('.. lees meer ..'); ?>
    </div>

    and yes, I split long posts manually with the Read more button in Admin.

    Then my (dutch) Read more comes just behind the last word where I put it and on the same line of text.

    Or am I missing something?

    i am also looking for an answer to this

    ok found a solution, instead of

    the_content(‘Read more »’);

    use

    $about_excerpt = get_the_content(‘Read more …’);
    echo $about_excerpt;

    Hi Drtanz,

    There is a file in /wp-includes/ called default-filters.php

    In that file you can comment out the auto-p in the various parts of your install.

    Maybe a moderator can confirm.
    I really don’t think adding a plug-in will solve anything.

    Good luck.
    -Alex.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Remove <p> from Read More’ is closed to new replies.