Timeline for Show only the beginning of post
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 28, 2017 at 15:44 | comment | added | Industrial Themes | In that case, try this instead for that line: if(empty($excerpt)) $excerpt = get_post_field('post_content', $postid); that will spit out the content verbatim but could be dangerous because if there is any html returned at the beginning of the post it will be counted in the character count, potentially leading to different length content returned from post to post. | |
Mar 28, 2017 at 15:42 | comment | added | Shan-x | This is better, but there is still not titles or formating (take all width instead of only the column). | |
Mar 28, 2017 at 15:39 | comment | added | Industrial Themes | Yes, this code strips all that out. If you don't want it stripped out, then change this line: if(empty($excerpt)) $excerpt = strip_shortcodes(strip_tags(apply_filters('the_excerpt', get_post_field('post_content', $postid)))); to this instead: if(empty($excerpt)) $excerpt = apply_filters('the_excerpt', get_post_field('post_content', $postid)); | |
Mar 28, 2017 at 15:35 | comment | added | Shan-x | This is not working. The first 300 characters are displyed, but there isn't any formating nor titles... This is all in one block. | |
Mar 28, 2017 at 14:51 | history | answered | Industrial Themes | CC BY-SA 3.0 |