Support

Account

Home Forums Front-end Issues Insert field at hook-position using function.php Reply To: Insert field at hook-position using function.php

  • Hi James,

    thanks for your advice. I tried to get the post ID but somehow it didn´t work.
    Now my code looks like this:

    
    // Add acf field to product generator page
    add_filter('vpc_container_end', 'add_table', 10, 1);
    function add_table($value){
        global $post;
        $value .= get_field('testfield', $post->ID);
        return $value;     
    }
    

    For testing I also tried to enter the ID of a specific post:

    
       $value .= get_field('testfield', 17890);
    

    But this doesn´t work either. :-/