Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jonathanhudak
Last active December 22, 2015 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanhudak/6467996 to your computer and use it in GitHub Desktop.
Save jonathanhudak/6467996 to your computer and use it in GitHub Desktop.
$post_image_url = $post_image[0];
$the_content = get_the_content();
$content_cleaned = strip_shortcodes( $the_content );
$new_excerpt = wp_trim_words( $content_cleaned, 35 );
$json_posts[] = array('title' => get_the_title(),'content'=>get_the_content(), 'excerpt'=>$new_excerpt, 'url'=>get_permalink(get_the_ID()), 'thumbnail'=>$post_image_url, 'post_class'=>$postClass);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment