'.wp_trim_words( strip_tags( strip_shortcodes( $content ) ) , '15' ).'
'; } $title = get_the_title(); $postid = get_the_ID(); $author = get_the_author(); // get_the_author_meta( string $field = '', int $user_id = false ); $postdate = get_the_date( ' F j, Y', $postid ); $rawhtml = str_replace(array( "{{ampforwp_post_url}}", "{{image}}", "{{width}}", "{{height}}", "{{title}}", "{{excerptContent}}", "{{authorname}}", "{{postdate}}", "{{image_alt}}" ), array( $ampforwp_post_url, $image, $width, $height, $title, $excerptContent, $author, $postdate, $image_alt ), $loopHtml); $rawhtml = ampforwp_replaceIfContentConditional("ampforwp_post_url", $ampforwp_post_url, $rawhtml); $rawhtml = ampforwp_replaceIfContentConditional("image", $image, $rawhtml); $rawhtml = ampforwp_replaceIfContentConditional("width", $width, $rawhtml); $rawhtml = ampforwp_replaceIfContentConditional("height", $height, $rawhtml); $rawhtml = ampforwp_replaceIfContentConditional("title", $title, $rawhtml); $rawhtml = ampforwp_replaceIfContentConditional("excerptContent", $excerptContent, $rawhtml); $rawhtml = ampforwp_replaceIfContentConditional("authorname", $author, $rawhtml); $rawhtml = ampforwp_replaceIfContentConditional("postdate", $postdate, $rawhtml); $contenthtml .= $rawhtml; } } /* Restore original Post Data */ wp_reset_postdata(); return $contenthtml; }