'.wp_trim_words( strip_tags( strip_shortcodes( $content ) ) , $ampforwp_excerpt_length ).'
'; } $title = get_the_title(); $postid = get_the_ID(); $author = get_the_author(); $tags = get_the_tags(); if(is_array($tags) && count($tags) > 0){ $tags = $tags[0]->name; } // 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}}", "{{tags}}" ), array( $ampforwp_post_url, $image, $width, $height, $title, $excerptContent, $author, $postdate, $image_alt, $tags, ), $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); $rawhtml = ampforwp_replaceIfContentConditional("image_alt", $image_alt, $rawhtml); $rawhtml = ampforwp_replaceIfContentConditional("tags", $tags, $rawhtml); $rawhtml = apply_filters( 'ampforwp_pb_cntmod_rawhtml', $rawhtml ); $contenthtml .= $rawhtml; } } /* Restore original Post Data */ wp_reset_postdata(); return $contenthtml; }