WordPress.org

Ready to get started?Download WordPress

Forums

Bug in the_content function (4 posts)

  1. xhark
    Member
    Posted 6 years ago #

    Hello

    I'm using WP 2.5 and default theme. In index.php of default theme :
    <?php the_content('Read &raquo;'); ?>

    but I want to include this text into <div> like this :
    <?php the_content('<div>Read &raquo;</div>'); ?>

    Problem : in html source code I can see :

    <div>Read &raquo;</div>
    <p></a></p>

    How to insert a blank line to separate link of post with div ?

    thank you

  2. haochi
    Member
    Posted 6 years ago #

    I think this will work... (make sure it's inside double quote)
    <?php the_content("<div>Read &raquo;\n</div>"); ?>

  3. Ivovic
    Member
    Posted 6 years ago #

    none of that is necessary.

    the more link by default is of the class "more-link" so all you need to do is style it any way you like.

    If you want it to appear on the next line, as though it were a div, all you need to do is...

    <?php the_content('Read »'); ?>

    and in your style.css put the definition:

    .more-link { display: block; }

  4. xhark
    Member
    Posted 6 years ago #

    thank you it works !

Topic Closed

This topic has been closed to new replies.

About this Topic