Home › Forums › General Issues › Add a lot of custom fields to the_content › Reply To: Add a lot of custom fields to the_content
Do you want all of the div you posted to be inserted into the div that holds the content? Yes you could do this here. For example you can use output buffering to enclose the content and then add it like this
add_filter( 'the_content', 'my_the_content_filter', 0 );
function my_the_content_filter( $content ) {
if (is_single()) {
global $post;
$pgLnk=get_post_meta($post->ID, 'Button', true);
ob_start();
?>
<div class="row">
... and the rest of the html
... and field you want to add to content
<?php
$content .= ob_get_clean();
}
return $content;
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.