Forums

Struggling with "the content" (3 posts)

  1. TomCraig
    Member
    Posted 1 year ago #

    Hi guys

    I have some custom post types, which I'm trying to pull out the first x no of words / letters of the post's content.

    However, when I use for example:

    substr(the_content(),0,100);

    this returns the entire post...

    I've tried using:

    $id->post_content

    but this returns nothing...

    I've also tried:

    <?php $cs_content = the_content(); ?>
    <p><?php substr($cs_content,0,10); ?>

    But again this returns the entire post..

    Any help would be MUCH appreciated.. This has been going on for a couple of days..

    Thanks

  2. stvwlf
    Member
    Posted 1 year ago #

  3. TomCraig
    Member
    Posted 1 year ago #

    Thanks stvwlf!!

    That did the trick!

Topic Closed

This topic has been closed to new replies.

About this Topic