WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Substr() WP functions? (4 posts)

  1. bcreighton
    Member
    Posted 6 years ago #

    Is there a way to use the substr() function on WP functions like the_content() and the_title()?

    If I try and use it, WP completely ignores it and displays the full string.

    Thanks

  2. the_content and the_title echo the string out directly.

    You want to use get_the_content and get_the_title and apply the substr to what is returned.

  3. bcreighton
    Member
    Posted 6 years ago #

    Worked perfectly, thank you!

  4. ermitanyo
    Member
    Posted 5 years ago #

    What if you want to use it with previous_post_link() or wp_get_archives()? Help please.

Topic Closed

This topic has been closed to new replies.

About this Topic