• Peter

    (@tooting-horn)


    When using ACF fields there doesn’t seem to be a way to make the fields appear in the Detailed Content option- ie the fields are empty in the generated LLMS.txt file (see link – Projects CPT)?
    How can i fix this?

    many thanks

    • This topic was modified 5 days, 10 hours ago by Peter.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Ryan Howard

    (@ryhowa)

    Hi Peter,

    You’re right that ACF fields don’t show up on their own. The plugin builds each page’s detailed content from the main editor content (post_content), and ACF values are stored separately in post meta and rendered by your theme’s template, so they never make it into the generated file.

    As of version 8.5.1 (just released) there’s a clean way to include them. I added a new filter, llms_generator_post_content, that lets you append your ACF fields to a post’s content before it’s written to llms.txt. Drop something like this in your theme’s functions.php or a small custom plugin:

    add_filter( 'llms_generator_post_content', function ( $content, $post ) {
        // Only target your Projects post type
        if ( $post->post_type !== 'project' ) {
            return $content;
        }
    
        $extra = '';
    
        // Repeat for each field you want included
        $client = get_field( 'client_name', $post->ID );
        if ( $client ) {
            $extra .= "\n\nClient: " . $client;
        }
    
        $summary = get_field( 'project_summary', $post->ID );
        if ( $summary ) {
            $extra .= "\n\n" . $summary;
        }
    
        return $content . $extra;
    }, 10, 2 );
    

    Swap project for your actual post type slug and client_name / project_summary for your field names. After adding it, update the plugin to 8.5.1, then use the LLMs.txt Reset option (Settings → LLMs.txt) to rebuild the cache so the new content is picked up.

    This keeps you in control of which fields are exposed and how they’re labeled. Let me know if you hit any snags.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.