Tag Info

New answers tagged

0

You can check to see if the length of the excerpt is longer than the max count. if(strlen($excerpt) > $count){ $excerpt = substr($excerpt, 0, $count) . '…'; } … is the correct ellipsis character to use.


0

You could add this to your themes functions.php file. This adds private posts to the initial loop on the homepage only. /** * Include private posts in homepage loop */ function show_private_posts_on_homepage($query) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'post_status', array( 'publish', 'private' ...


0

Apart from the horribly format issues you also have a typo: <?php $my_excerpt = $item->post_excerpt; if ($my_excerpt){ echo Str::limit($my_excerpt, 120);} else $content = ($item->post_content);{ ...



Top 50 recent answers are included