Hi.
I want to set read more
for my cms posts.
The code i found was <?php the_content( $more_link_text , $strip_teaser ); ?>
but still don't know how and where to use it.
Any suggestion?
Niloofar24 15 Posting Whiz
Recommended Answers
Jump to Post
<?php the_content( $more_link_text , $strip_teaser ); ?>
is for wordpress usage.
Jump to PostI wonder you 'read more' button will behave like one of the following?
1. link to actual post
2. it will trigger ajax to get rest of the post and append to it
3. show the rest of the post(The rest of post already loaded in div which hidden with …
Jump to PostIf it is link back to original post, then what you should do is
1. select all post from database.
2. crop the content based on character count(substr()) or what so ever filter way you need.
3. generate a link to the actually single post view.
Jump to PostShould not be using strrpos(), as from http://php.net/manual/en/function.strrpos.php, strrpos only search the character from string and return the index. we should probably do:
$short = substr($content_from_db, 0, 10)."..."
read the
Jump to Post
preg_match('/^.{1,260}\b/s', $body, $match);
ill start piece by piece
/^
this is the start of your variable whitch is the$body
.
the terminator or the;
in php to start another statement{1,260}\b
this is the boundery form the very beggining of your$body
up to the end the\s
- Whitespace e.g …
All 18 Replies
lps 71 Posting Pro in Training
jj.dcruz 0 Junior Poster
lps 71 Posting Pro in Training
Niloofar24 15 Posting Whiz
jj.dcruz 0 Junior Poster
lps 71 Posting Pro in Training
Niloofar24 15 Posting Whiz
lps 71 Posting Pro in Training
Niloofar24 15 Posting Whiz
Niloofar24 15 Posting Whiz
jj.dcruz 0 Junior Poster
lps 71 Posting Pro in Training
Niloofar24 15 Posting Whiz
jj.dcruz 0 Junior Poster
lps 71 Posting Pro in Training
Niloofar24 15 Posting Whiz
jj.dcruz 0 Junior Poster
Niloofar24 15 Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.