I would like to have my index or posts overview page load each post teaser starting at char 206 of each post's body content. This as all posts start with a general introduction in the post body content that is the same. To load that on the index.php teaser is useless information.
get_the_post I managed to load content but the
substr does not work as it should. It filter the content for the page. Not for the content of each page (body text).
Here is the code:
<?php /* Template name: Blog Page */ get_header(); the_post(); ?> <div class="grid-container blog" id="main-container"> <div class="grid-100 mobile-grid-100 nopadding" id="normal-content-wrap"> <h1><?php the_title();?></h1> <?php $content = apply_filters( 'the_content', get_the_content() ); //$content = strip_tags($content); echo substr($content, 200, 20); echo $content; //the_content();?> </div> </div> <?php get_footer(); ?>
As you can see I commented out the
strip_tags as I realized the formatting is fine. I do not want to loose the formatting. I just want each individual post to show a piece of that post starting at char x. How can this be done?