• Hello! I need to display the shortened form of the content, rather than the whole post, with the vanilla [get-post] … can I simply add a parameter to your code to do this? Give me a clue as to where and what!
    Thanks for any help. (I’m also using get-post in its templated form elsewhere and it’s just right, thanks!).

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter andrew_teal

    (@andrew_teal)

    I added

    $post_content = substr($post_content, 0, 400); // trim to shorter length
    $post_content = substr($post_content, 0, strripos($post_content, ' '));
    $post_content .= ' ... <a href="[my_base_url]/?p=' .$post->ID. '">Continue reading <span class="meta-nav">→</span></a>';

    to class-get-post-getter (after line 138), to shorten the posts …

    I bet there’re easier ways, but quick and dirty at the moment, I’m afraid …

    Plugin Author jtatum

    (@jtatum)

    Hi Andrew,

    Do you use the <more> tag to shorten the content, or do you just want to specify a number of characters? The more tag issue is written up as https://github.com/jtatum/get-post/issues/5

    If you want a number of characters, go ahead and open a bug on github. I’ll try to add something in for the next version.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Get Post] Need shortened content’ is closed to new replies.