Automatic split long post into multi page
-
Just edit /wordpress_folder/wp-includes/query.php
Find$pages = array( $post->post_content ); $multipage = 0;
Replace with
preg_match_all("#<p(.*?)</p>#", $content, $paragraphs); $count = 0; $max_paragraph = 10; foreach ($paragraphs[0] as $paragraph) { if ($count == $max_paragraph) { $content = str_replace($paragraph, $paragraph."<!--nextpage-->", $content); $count = 0; } else $count++; } if ( $page > 1 ) $more = 1; $multipage = 1; $content = str_replace("\n<!--nextpage-->\n", '<!--nextpage-->', $content); $content = str_replace("\n<!--nextpage-->", '<!--nextpage-->', $content); $content = str_replace("<!--nextpage-->\n", '<!--nextpage-->', $content); $pages = explode('<!--nextpage-->', $content); $numpages = count($pages);
I split post to multi page and each page have 10 paragraph. Maybe it’s only work for me. Of course, you can split base number of image, word,…
1 question I want ask that maybe write plugin like this to auto split long post or any edit in themes.
Edit core is work for me but maybe not a good way.
Sorry for my bad English. And thanks for any support…
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Automatic split long post into multi page’ is closed to new replies.