Forums

Remove <p> from Read More (5 posts)

  1. newkind
    Member
    Posted 3 weeks ago #

    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 ?

  2. esmi
    Member
    Posted 3 weeks ago #

    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?

  3. newkind
    Member
    Posted 3 weeks ago #

    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
  4. esmi
    Member
    Posted 3 weeks ago #

    Can't be done with the_content() - although you could try using get_the_content

  5. henkholland
    Member
    Posted 3 weeks ago #

    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?

Reply

You must log in to post.

About this Topic