WordPress word cutter

<?php $project_page_id=get_page_by_path('interior-decoration')->ID;?>
<?php echo get_the_title($project_page_id);?>

<?php $fcon=get_post($project_page_id)->post_content; //echo substr($fcon,0,100);
$words = explode(" ", $fcon);
$first = join(" ", array_slice($words, 0, 17));
echo $first;
?>

<a class="fprmore" href="<?php echo get_page_link($project_page_id);?>">Read More</a>

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>