Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function acf_excerpt($postid, $custom_field, $trim_length, $after){
- global $wp_query;
- global $post;
- $value = get_post_meta($postid, $custom_field, true);
- $custom_excerpt = preg_replace("#\[caption.*\](.*)\[\/caption\]#", "", $value);
- $new_excerpt = strip_tags(trim($custom_excerpt));
- $acf_excerpt = substr($new_excerpt,0,$trim_length);
- if ($acf_excerpt) {
- echo "<p class='text'>" . $acf_excerpt . $after . "</p>";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement