Support

Account

Home Forums General Issues How to trick plugins to think fields are the_content? Reply To: How to trick plugins to think fields are the_content?

  • Hi @james

    I see, maybe we can ignore my mentioning of the plugin. I want to include all of my fields for a layout to be included in the the custom post the_content()

    I tried this, which works and lets my ACF fields work with other plugins, but it repeats hundreds of times. Why is that? Here it is live http://jeremynative.com/onthissite/listing/sugar-loaf-hill/

    function add_acf_content( $content ) { 
    
         if( have_rows('repeater_field_name') ) {
              while( have_rows('repeater_field_name') ): the_row(); 
                 $content .= "<h2>" .  get_sub_field('title_sub_field') . "</h2>";
                 $content .= get_sub_field('sub_field_3'); 
            endwhile; 
        }
    
        return $content;
    }