SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Feb 2001
    Location
    Shanghai, China
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to replace everything after <!--more-->

    My client wants to use Wordpress to input blogposts, but the output is a custommade thing written by me. No problem, just this part:

    Wordpress uses this tag "<!--more-->" to separate between the first paragraph and the fulltext that is only visibal after clicking the link "click here to read the full text". So it's kind of like :

    bla bla bla bla
    <!--more-->
    more bla bla bla bla

    Now I'd need to replace <!--more--> with the "read more" link which is easy, but how do take off evertying after <!--more--> ?

    Thanks for help

  2. #2
    SitePoint Guru Ize's Avatar
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    809
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $pieces explode("<!--more-->",$thearticle);
    print 
    $pieces[0]; 

  3. #3
    SitePoint Addict
    Join Date
    Feb 2001
    Location
    Shanghai, China
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Arg, ****. Sure ..

    See, 3 years of PHP coding, and then it's the super simple stuff that one doesn't know.

    Admin, can this thread be deleted ? I'm feeling embarrassed

  4. #4
    SitePoint Guru Ize's Avatar
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    809
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't
    Most of the time it's the simple stuff that gets to you


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •